pthread: set the frame properties from the thread context, not user.
authorAnton Khirnov <anton@khirnov.net>
Thu, 24 Jan 2013 10:45:27 +0000 (11:45 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 24 Jan 2013 10:45:27 +0000 (11:45 +0100)
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.

libavcodec/pthread.c

index a4e3081..64cff43 100644 (file)
@@ -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,