forked from FFmpeg/FFmpeg
avcodec/avcodec: Move initializing frame-thrd encoder to encode_preinit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
c469c3c3b1
commit
3040876833
2 changed files with 6 additions and 6 deletions
|
@ -283,12 +283,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto free_and_end;
|
goto free_and_end;
|
||||||
|
|
||||||
if (CONFIG_FRAME_THREAD_ENCODER && av_codec_is_encoder(avctx->codec)) {
|
|
||||||
ret = ff_frame_thread_encoder_init(avctx);
|
|
||||||
if (ret < 0)
|
|
||||||
goto free_and_end;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (HAVE_THREADS
|
if (HAVE_THREADS
|
||||||
&& !(avci->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))) {
|
&& !(avci->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))) {
|
||||||
/* Frame-threaded decoders call FFCodec.init for their child contexts. */
|
/* Frame-threaded decoders call FFCodec.init for their child contexts. */
|
||||||
|
|
|
@ -668,6 +668,12 @@ int ff_encode_preinit(AVCodecContext *avctx)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CONFIG_FRAME_THREAD_ENCODER) {
|
||||||
|
ret = ff_frame_thread_encoder_init(avctx);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue