[vlc-commits] ffmpeg_GetFrameBuf: simplify

Rafaël Carré git at videolan.org
Tue Jun 4 20:05:18 CEST 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon May 27 09:18:57 2013 +0200| [0ec02c3d0e781e0c55dd900055521ed66bde06e1] | committer: Rémi Denis-Courmont

ffmpeg_GetFrameBuf: simplify

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 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;
 



More information about the vlc-commits mailing list