[vlc-devel] [PATCH 3/9] ffmpeg_GetFrameBuf: simplify

Rafaël Carré funman at videolan.org
Mon May 27 09:18:57 CEST 2013


---
 modules/codec/avcodec/video.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index bffce38..ec17cd7 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -901,6 +901,9 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
 
     /* */
     p_ff_pic->opaque = NULL;
+#if LIBAVCODEC_VERSION_MAJOR < 54
+    p_ff_pic->age = 256*256*256*64;
+#endif
 
     if( p_sys->p_va )
     {
@@ -913,18 +916,13 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
             return -1;
         }
 
-        /* */
-        p_ff_pic->type = FF_BUFFER_TYPE_USER;
-
-#if LIBAVCODEC_VERSION_MAJOR < 54
-        p_ff_pic->age = 256*256*256*64;
-#endif
-
         if( vlc_va_Get( p_sys->p_va, p_ff_pic ) )
         {
             msg_Err( p_dec, "VaGrabSurface failed" );
             return -1;
         }
+
+        p_ff_pic->type = FF_BUFFER_TYPE_USER;
         return 0;
     }
     else if( !p_sys->b_direct_rendering )
@@ -1008,10 +1006,6 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
     p_ff_pic->linesize[2] = p_pic->p[2].i_pitch;
     p_ff_pic->linesize[3] = 0;
 
-#if LIBAVCODEC_VERSION_MAJOR < 54
-    p_ff_pic->age = 256*256*256*64;
-#endif
-
     post_mt( p_sys );
     return 0;
 
-- 
1.8.1.2



More information about the vlc-devel mailing list