Commit 2c266656 authored by Dennis van Amerongen's avatar Dennis van Amerongen

* modules/codec/x264.c: backport [25152] fix for x264 threads=0 (auto)

parent 5d486354
...@@ -5,7 +5,7 @@ Changes between 0.8.6d and 0.8.6e (not yet released): ...@@ -5,7 +5,7 @@ Changes between 0.8.6d and 0.8.6e (not yet released):
Various bugfixes: Various bugfixes:
* Resume playback for viewing content over FTP * Resume playback for viewing content over FTP
* Fix XShm detection with remote X11 * Fixed XShm detection with remote X11
Security updates: Security updates:
* Subtitle demuxers overflow (CVE-2007-6681) * Subtitle demuxers overflow (CVE-2007-6681)
...@@ -24,13 +24,16 @@ Audio output: ...@@ -24,13 +24,16 @@ Audio output:
* Fixed 5.1 audio on ALSA * Fixed 5.1 audio on ALSA
Access: Access:
* Fix some RTSP hanging and user/password passing through RTSP URLs * Fixed some RTSP hanging and user/password passing through RTSP URLs
Stream output: Stream output:
* Fixed waiting for SPS/PPS problem in H.264 packetizer * Fixed waiting for SPS/PPS problem in H.264 packetizer
Encoders: Encoders:
* Improved compatibility for creating H.264 video playable on iPhones * Improved compatibility for creating H.264 video playable on iPhones
* Fixed detection of optimal amount of threads for multi-threaded H.264
encoding on multi-cpu systems
- Note that this is used when transcode threads is set to 0 (default)
Mac OS X Interface & Port: Mac OS X Interface & Port:
* Restored compatibility with Mac OS X 10.3.9 * Restored compatibility with Mac OS X 10.3.9
......
...@@ -1057,12 +1057,13 @@ static int Open ( vlc_object_t *p_this ) ...@@ -1057,12 +1057,13 @@ static int Open ( vlc_object_t *p_this )
p_sys->param.cpu &= ~X264_CPU_SSE2; p_sys->param.cpu &= ~X264_CPU_SSE2;
} }
/* BUILD 29 adds support for multi-threaded encoding while BUILD 49 (r543)
also adds support for threads = 0 for automatically selecting an optimal
value (cores * 1.5) based on detected CPUs. Default behavior for x264 is
threads = 1, however VLC usage differs and uses threads = 0 (auto) by
default unless ofcourse transcode threads is explicitly specified.. */
#if X264_BUILD >= 29 #if X264_BUILD >= 29
/* As of r543 x264 will autodetect the number of cpus and will set p_sys->param.i_threads = p_enc->i_threads;
the number of threads accordingly unless ofcourse the number of
threads is explicitly specified... */
if( p_enc->i_threads >= 1 )
p_sys->param.i_threads = p_enc->i_threads;
#endif #endif
/* Open the encoder */ /* Open the encoder */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment