changeset 33027:55de45e1d943

Do not use deprecated avcodec_thread_init, it is broken and does nothing currently. Set thread_count directly instead.
author reimar
date Sat, 26 Mar 2011 12:43:19 +0000
parents 03599ed42ec7
children 038ff73f9894
files libmpcodecs/vd_ffmpeg.c libmpcodecs/ve_lavc.c
diffstat 2 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Fri Mar 25 13:58:26 2011 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Sat Mar 26 12:43:19 2011 +0000
@@ -438,8 +438,7 @@
     if(sh->bih)
         avctx->bits_per_coded_sample= sh->bih->biBitCount;
 
-    if(lavc_param_threads > 1)
-        avcodec_thread_init(avctx, lavc_param_threads);
+    avctx->thread_count = lavc_param_threads;
     /* open it */
     if (avcodec_open(avctx, lavc_codec) < 0) {
         mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_CantOpenCodec);
--- a/libmpcodecs/ve_lavc.c	Fri Mar 25 13:58:26 2011 +0000
+++ b/libmpcodecs/ve_lavc.c	Sat Mar 26 12:43:19 2011 +0000
@@ -689,8 +689,7 @@
 	vf->priv->pic->quality = (int)(FF_QP2LAMBDA * lavc_param_vqscale + 0.5);
     }
 
-    if(lavc_param_threads > 1)
-	avcodec_thread_init(lavc_venc_context, lavc_param_threads);
+    lavc_venc_context->thread_count = lavc_param_threads;
 
     if (avcodec_open(lavc_venc_context, vf->priv->codec) != 0) {
 	mp_msg(MSGT_MENCODER,MSGL_ERR,MSGTR_CantOpenCodec);