mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/utils: run ff_frame_thread_encoder_init() only for encoders
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
46f67f4a34
commit
ed0c550564
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue