]> git.sesse.net Git - vlc/commitdiff
* modules/codec/ffmpeg/video_filter.c: resampling fix for when source or dest is...
authorGildas Bazin <gbazin@videolan.org>
Thu, 17 Mar 2005 13:12:10 +0000 (13:12 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 17 Mar 2005 13:12:10 +0000 (13:12 +0000)
modules/codec/ffmpeg/video_filter.c

index 9c3507e26b32652de8e512a74530dcc3842b0aa9..a0b062445881d0899d907165081f04b3fea2ec3b 100644 (file)
@@ -171,8 +171,24 @@ static int CheckInit( filter_t *p_filter )
           p_filter->fmt_in.video.i_width * p_filter->fmt_in.video.i_height >
           p_filter->fmt_out.video.i_width * p_filter->fmt_out.video.i_height;
 
-        if( p_filter->fmt_in.video.i_chroma != VLC_FOURCC('I','4','2','0') )
+        if( p_sys->i_src_ffmpeg_chroma != PIX_FMT_YUV420P &&
+            p_sys->i_src_ffmpeg_chroma != PIX_FMT_YUVJ420P &&
+            p_sys->i_dst_ffmpeg_chroma != PIX_FMT_YUV420P &&
+            p_sys->i_dst_ffmpeg_chroma != PIX_FMT_YUVJ420P )
+        {
+            msg_Err( p_filter, "img_resample_init only deals with I420" );
+            return VLC_EGENERIC;
+        }
+        else if( p_sys->i_src_ffmpeg_chroma != PIX_FMT_YUV420P &&
+                 p_sys->i_src_ffmpeg_chroma != PIX_FMT_YUVJ420P )
+        {
             p_sys->b_resize_first = VLC_FALSE;
+        }
+        else if( p_sys->i_dst_ffmpeg_chroma != PIX_FMT_YUV420P &&
+                 p_sys->i_dst_ffmpeg_chroma != PIX_FMT_YUVJ420P )
+        {
+            p_sys->b_resize_first = VLC_TRUE;
+        }
 
         if( p_sys->b_resize )
         {