[vlc-devel] commit: Allowed I422 direct rendering support when possible (avcodec). ( Laurent Aimar )

git version control git at videolan.org
Fri Feb 26 21:00:31 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Feb 26 20:51:20 2010 +0100| [b1deb11a2427118f470b9a528df22b2629acc669] | committer: Laurent Aimar 

Allowed I422 direct rendering support when possible (avcodec).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b1deb11a2427118f470b9a528df22b2629acc669
---

 modules/codec/avcodec/video.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index a021c01..e21b4ad 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -298,8 +298,6 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
     p_sys->i_direct_rendering_used = -1;
     if( var_CreateGetBool( p_dec, "ffmpeg-dr" ) &&
        (p_sys->p_codec->capabilities & CODEC_CAP_DR1) &&
-        /* Apparently direct rendering doesn't work with YUV422P */
-        p_sys->p_context->pix_fmt != PIX_FMT_YUV422P &&
         /* H264 uses too many reference frames */
         p_sys->i_codec_id != CODEC_ID_H264 &&
         /* No idea why ... but this fixes flickering on some TSCC streams */
@@ -973,6 +971,12 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
         if( (intptr_t)p_pic->p[i].p_pixels % i_align )
             b_compatible = false;
     }
+    if( p_context->pix_fmt == PIX_FMT_YUV422P && b_compatible )
+    {
+        if( 2 * p_pic->p[1].i_pitch != p_pic->p[0].i_pitch ||
+            2 * p_pic->p[2].i_pitch != p_pic->p[0].i_pitch )
+            b_compatible = false;
+    }
     if( !b_compatible )
     {
         decoder_DeletePicture( p_dec, p_pic );




More information about the vlc-devel mailing list