util/channel_layout: add default constructor

This commit is contained in:
meh 2016-05-23 23:06:00 +02:00
parent 9f87ecf5fa
commit fc693f8bfc

View File

@ -68,4 +68,10 @@ impl ChannelLayout {
av_get_channel_layout_nb_channels(self.bits()) av_get_channel_layout_nb_channels(self.bits())
} }
} }
pub fn default(number: i32) -> ChannelLayout {
unsafe {
ChannelLayout::from_bits_truncate(av_get_default_channel_layout(number) as c_ulonglong)
}
}
} }