]> git.sesse.net Git - vlc/blobdiff - modules/codec/avcodec/video.c
avcodec: adjust MT contention scope
[vlc] / modules / codec / avcodec / video.c
index 3a967b8c9e43c7bdf3be237edfd8485741d92c63..7d7a2fcfa27e5e721473dc74c75e66aa72e2d6cc 100644 (file)
@@ -914,7 +914,6 @@ static picture_t *ffmpeg_dr_GetFrameBuf(struct AVCodecContext *p_context)
 {
     decoder_t *p_dec = (decoder_t *)p_context->opaque;
     decoder_sys_t *p_sys = p_dec->p_sys;
-    vlc_va_t *p_va = p_sys->p_va;
 
     int i_width = p_context->width;
     int i_height = p_context->height;
@@ -989,6 +988,9 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
 
     /* */
     p_ff_pic->opaque = NULL;
+#if ! LIBAVCODEC_VERSION_CHECK(54, 34, 0, 79, 101)
+    p_ff_pic->pkt_pts = p_context->pkt ? p_context->pkt->pts : AV_NOPTS_VALUE;
+#endif
 #if LIBAVCODEC_VERSION_MAJOR < 54
     p_ff_pic->age = 256*256*256*64;
 #endif
@@ -1021,6 +1023,7 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
     }
 
     p_context->draw_horiz_band = NULL;
+    post_mt( p_sys );
 
     p_ff_pic->opaque = (void*)p_pic;
     p_ff_pic->type = FF_BUFFER_TYPE_USER;
@@ -1034,7 +1037,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;
 
-    post_mt( p_sys );
     return 0;
 }