summaryrefslogtreecommitdiffstats
path: root/media/filters
diff options
context:
space:
mode:
authortomfinegan <tomfinegan@chromium.org>2015-05-01 15:56:23 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-01 22:57:05 +0000
commit40de287cfbf7a843f903b72ed15c2f82cb0537ea (patch)
treef4dceee9be6945453eaa908a5b4b109dbafd01de /media/filters
parent9512ca75b06c184ef9557499a96de3d5df73eb5f (diff)
downloadchromium_src-40de287cfbf7a843f903b72ed15c2f82cb0537ea.zip
chromium_src-40de287cfbf7a843f903b72ed15c2f82cb0537ea.tar.gz
chromium_src-40de287cfbf7a843f903b72ed15c2f82cb0537ea.tar.bz2
vpx_video_decoder: limit decode threads to number of processors.
Avoid decoding VP8A with a single thread. BUG=480724 Review URL: https://codereview.chromium.org/1120643005 Cr-Commit-Position: refs/heads/master@{#328005}
Diffstat (limited to 'media/filters')
-rw-r--r--media/filters/vpx_video_decoder.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
index dc03400..4056323 100644
--- a/media/filters/vpx_video_decoder.cc
+++ b/media/filters/vpx_video_decoder.cc
@@ -17,6 +17,7 @@
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/sys_byteorder.h"
+#include "base/sys_info.h"
#include "base/trace_event/trace_event.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/decoder_buffer.h"
@@ -64,6 +65,8 @@ static int GetThreadCount(const VideoDecoderConfig& config) {
decode_threads = 4;
}
+ decode_threads = std::min(decode_threads,
+ base::SysInfo::NumberOfProcessors());
return decode_threads;
}