fix(util/color/space): use appropriate color space name function for 6.0+

This commit is contained in:
tilpner
2023-05-24 17:22:59 +02:00
committed by Till Höppner
parent 9c152d81fa
commit f389c72ea8
+9 -1
View File
@@ -26,7 +26,15 @@ pub enum Space {
impl Space {
pub fn name(&self) -> &'static str {
unsafe { from_utf8_unchecked(CStr::from_ptr(av_get_colorspace_name((*self).into())).to_bytes()) }
#[cfg(feature = "ffmpeg_6_0")]
unsafe {
from_utf8_unchecked(CStr::from_ptr(av_color_space_name((*self).into())).to_bytes())
}
#[cfg(not(feature = "ffmpeg_6_0"))]
unsafe {
from_utf8_unchecked(CStr::from_ptr(av_get_colorspace_name((*self).into())).to_bytes())
}
}
}