diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2011-03-29 18:54:33 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2011-03-29 18:54:33 +0300 |
commit | 7131fceb0b80c462604e65fe1869db6e14791b4e (patch) | |
tree | dbd157bfc0d2e0ee088ca9272525f2c9875b060c /libmpcodecs/vd_ffmpeg.c | |
parent | 16e29bebf05b9ae39ebb2f4aa6afb7496fab3ca6 (diff) | |
download | mpv-7131fceb0b80c462604e65fe1869db6e14791b4e.tar.bz2 mpv-7131fceb0b80c462604e65fe1869db6e14791b4e.tar.xz |
vd_ffmpeg: fix thread count setting with latest ffmpeg-mt
Recent ffmpeg-mt versions changed the API for setting the number of
decoding threads to use (I'm not sure whether dropping backwards
compatibility was intentional or not). As a result only one thread was
used. Make the thread setting compatible with the new API to restore
proper multithreaded decoding.
Diffstat (limited to 'libmpcodecs/vd_ffmpeg.c')
-rw-r--r-- | libmpcodecs/vd_ffmpeg.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index d56a63ea59..2424dda95b 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -379,8 +379,10 @@ static int init(sh_video_t *sh){ if(sh->bih) avctx->bits_per_coded_sample= sh->bih->biBitCount; - if(lavc_param->threads > 1) + if(lavc_param->threads > 1) { + avctx->thread_count = lavc_param->threads; avcodec_thread_init(avctx, lavc_param->threads); + } /* open it */ if (avcodec_open(avctx, lavc_codec) < 0) { mp_tmsg(MSGT_DECVIDEO, MSGL_ERR, "Could not open codec.\n"); |