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.
This commit is contained in:
Uoti Urpala 2011-03-29 18:54:33 +03:00
parent 16e29bebf0
commit 7131fceb0b
1 changed files with 3 additions and 1 deletions

View File

@ -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");