summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2017-03-28 15:04:46 -0400
committerRonald S. Bultje <rsbultje@gmail.com>2017-03-28 18:04:27 -0400
commit027ee9b3ed697ff080be0f14b47a11c89ce68cdd (patch)
tree94eaf1ef786a51be44cbb3a9789670fc4f33fabe
parentbddabfaab65808e40605181d579ffcd85bfe4c26 (diff)
downloadffmpeg-streaming-027ee9b3ed697ff080be0f14b47a11c89ce68cdd.zip
ffmpeg-streaming-027ee9b3ed697ff080be0f14b47a11c89ce68cdd.tar.gz
pthread_frame: don't sync items between threads for intra-only codecs.
Intra-only codecs should either be able to read these items from the bitstream, or they should be set upon codec initialization. In both cases, syncing these items at runtime is unnecessary. In practice, this fixes race conditions for decoders that read these values from the bitstream.
-rw-r--r--libavcodec/pthread_frame.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index b618be0..295763a 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -244,7 +244,7 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src,
{
int err = 0;
- if (dst != src) {
+ if (dst != src && (for_user || !(av_codec_get_codec_descriptor(src)->props & AV_CODEC_PROP_INTRA_ONLY))) {
dst->time_base = src->time_base;
dst->framerate = src->framerate;
dst->width = src->width;
OpenPOWER on IntegriCloud