Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: media/renderers/video_renderer_impl.cc

Issue 1217943003: Use base/threading interface instead of calling Win32 API directly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/video_renderer_impl.cc
diff --git a/media/renderers/video_renderer_impl.cc b/media/renderers/video_renderer_impl.cc
index d688ca57c7f333c39cbe89c4349f6133fc04301d..09f0218ea4f7c93a4f8c42830271bb2060db098e 100644
--- a/media/renderers/video_renderer_impl.cc
+++ b/media/renderers/video_renderer_impl.cc
@@ -266,13 +266,15 @@ void VideoRendererImpl::OnFrameDropped() {
void VideoRendererImpl::CreateVideoThread() {
// This may fail and cause a crash if there are too many threads created in
// the current process. See http://crbug.com/443291
- CHECK(base::PlatformThread::Create(0, this, &thread_));
-
+ const base::ThreadPriority priority =
#if defined(OS_WIN)
- // Bump up our priority so our sleeping is more accurate.
- // TODO(scherkus): find out if this is necessary, but it seems to help.
- ::SetThreadPriority(thread_.platform_handle(), THREAD_PRIORITY_ABOVE_NORMAL);
-#endif // defined(OS_WIN)
+ // Bump up our priority so our sleeping is more accurate.
+ // TODO(scherkus): find out if this is necessary, but it seems to help.
+ base::ThreadPriority::DISPLAY;
+#else
+ base::ThreadPriority::NORMAL;
+#endif
+ CHECK(base::PlatformThread::CreateWithPriority(0, this, &thread_, priority));
}
void VideoRendererImpl::OnVideoFrameStreamInitialized(bool success) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698