fix(util/frame): access channel layout directly

This commit is contained in:
tilpner
2023-05-24 17:22:59 +02:00
committed by Till Höppner
parent f389c72ea8
commit 467516228c
+2 -2
View File
@@ -4,7 +4,7 @@ use std::{
slice,
};
use libc::{c_int, c_ulonglong};
use libc::c_int;
use super::Frame;
use crate::{ffi::*, util::format, ChannelLayout};
@@ -65,7 +65,7 @@ impl Audio {
#[inline]
pub fn channel_layout(&self) -> ChannelLayout {
unsafe { ChannelLayout::from_bits_truncate(av_frame_get_channel_layout(self.as_ptr()) as c_ulonglong) }
unsafe { ChannelLayout::from((*self.as_ptr()).ch_layout) }
}
#[inline]