Those were useful when avcodec_thread_init() was a public functions. It
was deprecated and removed some time ago, so those checks are not needed
anymore.
int ff_thread_init(AVCodecContext *avctx)
{
int ff_thread_init(AVCodecContext *avctx)
{
- if (avctx->thread_opaque) {
- av_log(avctx, AV_LOG_ERROR, "avcodec_thread_init is ignored after avcodec_open\n");
- return -1;
- }
-
#if HAVE_W32THREADS
w32thread_init();
#endif
#if HAVE_W32THREADS
w32thread_init();
#endif
validate_thread_parameters(avctx);
if (avctx->active_thread_type&FF_THREAD_SLICE)
return thread_init(avctx);
else if (avctx->active_thread_type&FF_THREAD_FRAME)
return frame_thread_init(avctx);
validate_thread_parameters(avctx);
if (avctx->active_thread_type&FF_THREAD_SLICE)
return thread_init(avctx);
else if (avctx->active_thread_type&FF_THREAD_FRAME)
return frame_thread_init(avctx);
avctx->time_base.den = avctx->sample_rate;
}
avctx->time_base.den = avctx->sample_rate;
}
- if (HAVE_THREADS && !avctx->thread_opaque) {
ret = ff_thread_init(avctx);
if (ret < 0) {
goto free_and_end;
ret = ff_thread_init(avctx);
if (ret < 0) {
goto free_and_end;