[vlc-commits] AVcodec: limit the number of auto-detected threads to 4 by default

Jean-Baptiste Kempf git at videolan.org
Thu Feb 23 18:01:06 CET 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Feb 23 17:59:49 2012 +0100| [ce85748bd0dcc074d69c71d51ead53968eebeb9e] | committer: Jean-Baptiste Kempf

AVcodec: limit the number of auto-detected threads to 4 by default

Revert this when you have found the reason why it fails for soo many
people, in avi, mp4 (and mkv before the HACK)

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

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

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 3e616e8..7332bf0 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -355,6 +355,9 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
         i_thread_count = vlc_GetCPUCount();
         if( i_thread_count > 1 )
             i_thread_count++;
+
+        //FIXME: take in count the decoding time
+        i_thread_count = __MIN( i_thread_count, 4 );
     }
     i_thread_count = __MIN( i_thread_count, 16 );
     msg_Dbg( p_dec, "allowing %d thread(s) for decoding", i_thread_count );



More information about the vlc-commits mailing list