[vlc-commits] Clip number of thread to 16 when using threaded decoding in avcodec.

Laurent Aimar git at videolan.org
Wed Jan 11 16:13:45 CET 2012


vlc/vlc-1.2 | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Jan 10 23:10:48 2012 +0100| [7029ccb80b67594ae598f3a7451bf0384a979645] | committer: Jean-Baptiste Kempf

Clip number of thread to 16 when using threaded decoding in avcodec.

It workarounds an avcodec issue.
(cherry picked from commit e587ce36787d2519a774d27465d71b2272c9c6c4)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=7029ccb80b67594ae598f3a7451bf0384a979645
---

 modules/codec/avcodec/video.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 22031b1..e40bac7 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -337,6 +337,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
     int i_thread_count = var_InheritInteger( p_dec, "ffmpeg-threads" );
     if( i_thread_count <= 0 )
         i_thread_count = vlc_GetCPUCount();
+    i_thread_count = __MIN( i_thread_count, 16 );
     msg_Dbg( p_dec, "allowing %d thread(s) for decoding", i_thread_count );
     p_sys->p_context->thread_count = i_thread_count;
 #endif



More information about the vlc-commits mailing list