From 361522198e1a9dda2d76efafa3d2a67b045f896e Mon Sep 17 00:00:00 2001 From: John Bradley Date: Tue, 10 Mar 2015 12:55:53 -0500 Subject: [PATCH] deps-libff: Workaround to PNG multithreaded bug in ffmpeg FFMpeg has an issue where png decoding will not correctly begin until its optimal-thread-detection finishes in multi-threaded mode. This unfortunately is after decoding has begun. --- deps/libff/libff/ff-demuxer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deps/libff/libff/ff-demuxer.c b/deps/libff/libff/ff-demuxer.c index 96e2cd8de..49b28103d 100644 --- a/deps/libff/libff/ff-demuxer.c +++ b/deps/libff/libff/ff-demuxer.c @@ -246,6 +246,10 @@ static bool find_decoder(struct ff_demuxer *demuxer, AVStream *stream) // > 1 codec_context->refcounted_frames = 1; + // png decoder has serious issues with multiple threads + if (codec_context->codec_id == AV_CODEC_ID_PNG) + codec_context->thread_count = 1; + if (demuxer->options.is_hw_decoding) { AVHWAccel *hwaccel = find_hwaccel_codec(codec_context);