]> git.sesse.net Git - vlc/commitdiff
Check for codec specific pitches alignment in avcodec.
authorLaurent Aimar <fenrir@videolan.org>
Fri, 26 Feb 2010 19:36:29 +0000 (20:36 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Fri, 26 Feb 2010 19:59:55 +0000 (20:59 +0100)
 It is ugly to have this list of codec id (as it can become unsynchronized), but
ffmpeg does not provide a way to retreive this information :(

modules/codec/avcodec/video.c

index 2fda8006e30817f451257af36af5be35f21e0cf4..c4d443f3e7e4d5e88132ecfacb9ce12c441ca290 100644 (file)
@@ -948,7 +948,20 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
         b_compatible = false;
     for( int i = 0; i < p_pic->i_planes && b_compatible; i++ )
     {
-        const unsigned i_align = i == 0 ? 16 : 8;
+        unsigned i_align;
+        switch( p_sys->i_codec_id )
+        {
+        case CODEC_ID_SVQ1:
+        case CODEC_ID_VP5:
+        case CODEC_ID_VP6:
+        case CODEC_ID_VP6F:
+        case CODEC_ID_VP6A:
+            i_align = 16;
+            break;
+        default:
+            i_align = i == 0 ? 16 : 8;
+            break;
+        }
         if( p_pic->p[i].i_pitch % i_align )
             b_compatible = false;
         if( (intptr_t)p_pic->p[i].p_pixels % i_align )