forked from mirrors/gstreamer-rs
Return 0 for the mask of any negative GstAudioChannelPosition value.
This commit is contained in:
parent
3ea34695dd
commit
ae1455e4d6
1 changed files with 5 additions and 1 deletions
|
@ -20,8 +20,12 @@ use array_init;
|
|||
|
||||
impl AudioChannelPosition {
|
||||
pub fn to_mask(self) -> u64 {
|
||||
let pos = self.to_glib();
|
||||
if pos < 0 {
|
||||
return 0;
|
||||
}
|
||||
unsafe {
|
||||
let val = mem::transmute::<ffi::GstAudioChannelPosition, u32>(self.to_glib());
|
||||
let val = mem::transmute::<ffi::GstAudioChannelPosition, u32>(pos);
|
||||
1 << val
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue