]> git.sesse.net Git - vlc/blobdiff - modules/codec/avcodec/deinterlace.c
ffmpeg chroma: Change GetVlcChroma and GetFfmpegChroma to use a video_format_t, so...
[vlc] / modules / codec / avcodec / deinterlace.c
index b297bbdd0ed5b1e8154ceebe7dc09033c4d419f1..fbc553d7016433a6d8eb597b13cccfd0e357b91f 100644 (file)
@@ -75,8 +75,9 @@ int OpenDeinterlace( vlc_object_t *p_this )
     filter_sys_t *p_sys;
 
     /* Check if we can handle that formats */
-    if( GetFfmpegChroma( p_filter->fmt_in.video.i_chroma ) < 0 )
+    if( TestFfmpegChroma( -1, p_filter->fmt_in.i_codec  ) != VLC_SUCCESS )
     {
+        msg_Err( p_filter, "Failed to match chroma type" );
         return VLC_EGENERIC;
     }
 
@@ -88,8 +89,12 @@ int OpenDeinterlace( vlc_object_t *p_this )
     }
 
     /* Misc init */
-    p_sys->i_src_ffmpeg_chroma =
-        GetFfmpegChroma( p_filter->fmt_in.video.i_chroma );
+    p_filter->fmt_in.video.i_chroma = p_filter->fmt_in.i_codec;
+    if( GetFfmpegChroma( &p_sys->i_src_ffmpeg_chroma, p_filter->fmt_in.video ) != VLC_SUCCESS )
+    {
+        msg_Err( p_filter, "Failed to match chroma type" );
+        return VLC_EGENERIC;
+    }
     p_filter->pf_video_filter = Deinterlace;
 
     msg_Dbg( p_filter, "deinterlacing" );