diff options
author | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-30 23:05:18 +0000 |
---|---|---|
committer | fischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-30 23:05:18 +0000 |
commit | 65616819960f4f4b90c303e6ef2772b78c5ea175 (patch) | |
tree | 89af2a3fe32ded2c30b2aa510a1d860a58d585a5 | |
parent | f67d1f2b6bb4b1874ae652b69442af70651537f7 (diff) | |
download | chromium_src-65616819960f4f4b90c303e6ef2772b78c5ea175.zip chromium_src-65616819960f4f4b90c303e6ef2772b78c5ea175.tar.gz chromium_src-65616819960f4f4b90c303e6ef2772b78c5ea175.tar.bz2 |
Yield instead of spinning the CPU in CopyOutputSampleDataToPictureBuffer.
Also guard in Initialize() against bad API/card combos.
BUG=139671
Review URL: https://chromiumcodereview.appspot.com/10832067
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149059 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/common/gpu/media/dxva_video_decode_accelerator.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator.cc b/content/common/gpu/media/dxva_video_decode_accelerator.cc index c99121c..fb019ca 100644 --- a/content/common/gpu/media/dxva_video_decode_accelerator.cc +++ b/content/common/gpu/media/dxva_video_decode_accelerator.cc @@ -391,10 +391,11 @@ bool DXVAVideoDecodeAccelerator::DXVAPictureBuffer:: // Ideally, this should be done immediately before the draw call that uses // the texture. Flush it once here though. hr = query_->Issue(D3DISSUE_END); + RETURN_ON_HR_FAILURE(hr, "Failed to issue END", false); do { hr = query_->GetData(NULL, 0, D3DGETDATA_FLUSH); if (hr == S_FALSE) - Sleep(0); + Sleep(1); // Poor-man's Yield(). } while (hr == S_FALSE); eglBindTexImage( @@ -489,6 +490,10 @@ bool DXVAVideoDecodeAccelerator::CreateD3DDevManager() { hr = device_->CreateQuery(D3DQUERYTYPE_EVENT, &query_); RETURN_ON_HR_FAILURE(hr, "Failed to create D3D device query", false); + // Ensure query_ API works (to avoid an infinite loop later in + // CopyOutputSampleDataToPictureBuffer). + hr = query_->Issue(D3DISSUE_END); + RETURN_ON_HR_FAILURE(hr, "Failed to issue END test query", false); return true; } |