[FFmpeg-cvslog] pthread: set the frame properties from the thread context, not user.

Anton Khirnov git at videolan.org
Thu Feb 14 15:30:24 CET 2013


ffmpeg | branch: release/0.10 | Anton Khirnov <anton at khirnov.net> | Thu Jan 24 11:45:27 2013 +0100| [a4c9260e6914aa82274d1582e1e4ce94ce5194ed] | committer: Anton Khirnov

pthread: set the frame properties from the thread context, not user.

Right now, the frame properties are set from the user-facing
AVCodecContext before it is updated from the thread context, which is
wrong since they may be invalid or obsolete.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a4c9260e6914aa82274d1582e1e4ce94ce5194ed
---

 libavcodec/pthread.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index a4e3081..64cff43 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -631,10 +631,10 @@ int ff_thread_decode_frame(AVCodecContext *avctx,
         *picture = p->frame;
         *got_picture_ptr = p->got_frame;
         picture->pkt_dts = p->avpkt.dts;
-        picture->sample_aspect_ratio = avctx->sample_aspect_ratio;
-        picture->width  = avctx->width;
-        picture->height = avctx->height;
-        picture->format = avctx->pix_fmt;
+        picture->sample_aspect_ratio = p->avctx->sample_aspect_ratio;
+        picture->width  = p->avctx->width;
+        picture->height = p->avctx->height;
+        picture->format = p->avctx->pix_fmt;
 
         /*
          * A later call with avkpt->size == 0 may loop over all threads,



More information about the ffmpeg-cvslog mailing list