Chromium Code Reviews| Index: content/common/gpu/media/dxva_video_decode_accelerator.cc |
| =================================================================== |
| --- content/common/gpu/media/dxva_video_decode_accelerator.cc (revision 167469) |
| +++ content/common/gpu/media/dxva_video_decode_accelerator.cc (working copy) |
| @@ -73,6 +73,10 @@ |
| log << ", HRESULT: 0x" << std::hex << result, \ |
| error_code, ret); |
| +// Maximum number of iterations we allow before aborting the attempt to flush |
| +// the batched queries to the driver. |
| +enum { kMaxiterationsForD3dFlush = 10 }; |
|
Ami GONE FROM CHROMIUM
2012/11/13 23:31:25
s/xi/xI/
ananta
2012/11/14 01:06:47
Done.
|
| + |
| static IMFSample* CreateEmptySample() { |
| base::win::ScopedComPtr<IMFSample> sample; |
| HRESULT hr = MFCreateSample(sample.Receive()); |
| @@ -396,11 +400,16 @@ |
| // 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(1); // Poor-man's Yield(). |
| - } while (hr == S_FALSE); |
| + |
| + // The loop below attempts to flush the batched queries to the driver. We |
| + // don't want to loop endlessly waiting for the driver to return success. |
| + // The current workaround is to allow a max of kMaxiterationsForD3dFlush |
| + // iterations. |
|
Ami GONE FROM CHROMIUM
2012/11/13 23:31:25
This comment is useless; it restates in English wh
ananta
2012/11/14 01:06:47
Rephrased. There is also some new code which addre
|
| + int iterations = 0; |
| + while ((query_->GetData(NULL, 0, D3DGETDATA_FLUSH) == S_FALSE) && |
| + ++iterations < kMaxiterationsForD3dFlush) { |
| + Sleep(1); // Poor-man's Yield(). |
| + } |
| eglBindTexImage( |
| static_cast<EGLDisplay*>(eglGetDisplay(EGL_DEFAULT_DISPLAY)), |
| decoding_surface_, |