]> git.sesse.net Git - vlc/commitdiff
AVcodec: limit the number of auto-detected threads to 4 by default
authorJean-Baptiste Kempf <jb@videolan.org>
Thu, 23 Feb 2012 16:59:49 +0000 (17:59 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 23 Feb 2012 16:59:49 +0000 (17:59 +0100)
Revert this when you have found the reason why it fails for soo many
people, in avi, mp4 (and mkv before the HACK)

modules/codec/avcodec/video.c

index 3e616e82935ebc6f2e78065f4447faa58a9e5b60..7332bf078c11308627587380b9b03aa6e3e8c228 100644 (file)
@@ -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 );