]> git.sesse.net Git - vlc/commitdiff
ffmpeg_GetFrameBuf: simplify
authorRafaël Carré <funman@videolan.org>
Mon, 27 May 2013 07:18:57 +0000 (09:18 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 4 Jun 2013 17:55:05 +0000 (20:55 +0300)
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
modules/codec/avcodec/video.c

index bffce38a8a9579129219ae8d40543bde6287739b..ec17cd76f7f7013d404d3e01eba79d7be667ec51 100644 (file)
@@ -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;