]> git.sesse.net Git - vlc/commitdiff
Workaround for video size incompatible with the colorspace.
authorLaurent Aimar <fenrir@videolan.org>
Thu, 3 Nov 2011 19:28:51 +0000 (20:28 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Thu, 3 Nov 2011 19:31:15 +0000 (20:31 +0100)
Close #4206.

src/input/decoder.c

index c285becafe706028d008e9297f23f90e47742a72..ce878a9732b45b97d799ca4567eb0e7e110f9f37 100644 (file)
@@ -2345,6 +2345,18 @@ static picture_t *vout_new_buffer( decoder_t *p_dec )
         fmt.i_chroma = p_dec->fmt_out.i_codec;
         p_owner->video = fmt;
 
+        if( vlc_fourcc_IsYUV( fmt.i_chroma ) )
+        {
+            vlc_chroma_description_t *dsc = vlc_fourcc_GetChromaDescription( fmt.i_chroma );
+            for( int i = 0; dsc && i < dsc->plane_count; i++ )
+            {
+                while( fmt.i_width % dsc->p[i].w.den )
+                    fmt.i_width++;
+                while( fmt.i_height % dsc->p[i].h.den )
+                    fmt.i_height++;
+            }
+        }
+
         if( !fmt.i_visible_width || !fmt.i_visible_height )
         {
             if( p_dec->fmt_in.video.i_visible_width &&