mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 00:26:31 +00:00
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