aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-01-25 16:06:03 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-25 16:47:15 +0100
commited0c550564a8502210e8c8c6cd5604ca1f390cd9 (patch)
treea4a8ff6061a88d896ebd4a2c36660bcd5b9fd334
parent46f67f4a34cab5f5686baf1605dd77d3c70740b5 (diff)
downloadffmpeg-ed0c550564a8502210e8c8c6cd5604ca1f390cd9.tar.gz
avcodec/utils: run ff_frame_thread_encoder_init() only for encoders
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index fb6c5f450e..abddd6f4a4 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1317,7 +1317,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
if (!HAVE_THREADS)
av_log(avctx, AV_LOG_WARNING, "Warning: not compiled with thread support, using thread emulation\n");
- if (CONFIG_FRAME_THREAD_ENCODER) {
+ if (CONFIG_FRAME_THREAD_ENCODER && av_codec_is_encoder(avctx->codec)) {
ff_unlock_avcodec(codec); //we will instanciate a few encoders thus kick the counter to prevent false detection of a problem
ret = ff_frame_thread_encoder_init(avctx, options ? *options : NULL);
ff_lock_avcodec(avctx, codec);