diff options
author | Roland Scheidegger <rscheidegger_lists@hispeed.ch> | 2011-12-21 21:23:21 +0100 |
---|---|---|
committer | Roland Scheidegger <rscheidegger_lists@hispeed.ch> | 2011-12-21 21:23:21 +0100 |
commit | 93e8da81f50c7c3d5c5d24fb997ec8ff067084dd (patch) | |
tree | 19f65384596b6924981e5c742a189cda02975589 /src | |
parent | cc27f8ffa02c70fd8a168a23b5494575adc9c881 (diff) | |
download | xine-lib-93e8da81f50c7c3d5c5d24fb997ec8ff067084dd.tar.gz xine-lib-93e8da81f50c7c3d5c5d24fb997ec8ff067084dd.tar.bz2 |
Fix multithreaded initialization with API change
thread count needs to be set before avcodec_open otherwise it will be stuck
with a single thread at least for h264 (might also want to use avcodec_open2
instead?)
Diffstat (limited to 'src')
-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 2ec18c55f..379732a82 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -329,6 +329,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); @@ -356,14 +363,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]; |