This isn't protected by a mutex but is still safe.
Needed for the next commit.
---
 libavcodec/pthread.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index f61c166..f0ef1e3 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -252,8 +252,6 @@ static attribute_align_arg void *decode_frame_thread(void *arg)
         if (!codec->update_context) ff_report_frame_setup_done(avctx);
 
         pthread_mutex_lock(&p->mutex);
-        avcodec_get_frame_defaults(&p->picture);
-        p->got_picture = 0;
         p->result = codec->decode(avctx, &p->picture, &p->got_picture, p->buf, p->buf_size);
 
         if (p->state == STATE_PREDECODING) ff_report_frame_setup_done(avctx);
@@ -473,6 +471,9 @@ int ff_decode_frame_threaded(AVCodecContext *avctx,
     *(AVFrame*)data = p->picture;
     *data_size = p->got_picture;
 
+    avcodec_get_frame_defaults(&p->picture);
+    p->got_picture = 0;
+
     if (fctx->next_decoding >= thread_count) fctx->next_decoding = 0;
     if (fctx->next_finished >= thread_count) fctx->next_finished = 0;
 
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to