diff options
-rw-r--r-- | src/combined/ffmpeg/ff_video_decoder.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index 5334b8d71..0b7c2222c 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -324,6 +324,13 @@ static void init_video_codec (ff_video_decoder_t *this, unsigned int codec_type) if (this->class->choose_speed_over_accuracy) this->context->flags2 |= CODEC_FLAG2_FAST; +#ifdef DEPRECATED_AVCODEC_THREAD_INIT + if (this->class->thread_count > 1) { + if (this->codec->id != CODEC_ID_SVQ3) + this->context->thread_count = this->class->thread_count; + } +#endif + pthread_mutex_lock(&ffmpeg_lock); if (avcodec_open (this->context, this->codec) < 0) { pthread_mutex_unlock(&ffmpeg_lock); @@ -351,14 +358,13 @@ static void init_video_codec (ff_video_decoder_t *this, unsigned int codec_type) } } +#ifndef DEPRECATED_AVCODEC_THREAD_INIT if (this->class->thread_count > 1) { if (this->codec->id != CODEC_ID_SVQ3 -#ifndef DEPRECATED_AVCODEC_THREAD_INIT - && avcodec_thread_init(this->context, this->class->thread_count) != -1 -#endif - ) + && avcodec_thread_init(this->context, this->class->thread_count) != -1) this->context->thread_count = this->class->thread_count; } +#endif this->context->skip_loop_filter = skip_loop_filter_enum_values[this->class->skip_loop_filter_enum]; |