encoder/audio: add set_channels()
For this a method for `ChannelLayout` to retrieve the number of channels was also added.
This commit is contained in:
@ -59,3 +59,11 @@ bitflags! {
|
||||
const STEREO_DOWNMIX = STEREO_LEFT.bits | STEREO_RIGHT.bits,
|
||||
}
|
||||
}
|
||||
|
||||
impl ChannelLayout {
|
||||
pub fn channels(&self) -> i32 {
|
||||
unsafe {
|
||||
av_get_channel_layout_nb_channels(self.bits())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user