Commit 3b1a548f authored by ananta@chromium.org's avatar ananta@chromium.org

H/W decoded H.264 videos would not play at times on Windows 8. This was...

H/W decoded H.264 videos would not play at times on Windows 8. This was because the DXVA decoder in its processinput
implementation was returning the error MF_A_NOTACCEPTING which was being treated as a platform failure code. This was
incorrect. As per msdn when we get this error it means that the decoder has all the input it needs to produce one output
sample. We need to call ProcessOutput and then ProcessInput again.

Fixes bug http://code.google.com/p/chromium/issues/detail?id=140989

BUG=140989
R=fischman
Review URL: https://chromiumcodereview.appspot.com/10827308

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151503 0039d316-1c4b-4281-b951-d872f2087c98
parent 1f73d547
...@@ -584,6 +584,21 @@ void DXVAVideoDecodeAccelerator::Decode( ...@@ -584,6 +584,21 @@ void DXVAVideoDecodeAccelerator::Decode(
inputs_before_decode_++; inputs_before_decode_++;
HRESULT hr = decoder_->ProcessInput(0, sample, 0); HRESULT hr = decoder_->ProcessInput(0, sample, 0);
// As per msdn if the decoder returns MF_E_NOTACCEPTING then it means that it
// has enough data to produce an output sample. In this case the recommended
// options are to
// 1. Generate new output by calling IMFTransform::ProcessOutput
// 2. Flush the input data
// We implement the first option, i.e to retrieve the output sample and then
// process the input again. Failure in either of these steps is treated as a
// decoder failure.
if (hr == MF_E_NOTACCEPTING) {
DoDecode();
RETURN_AND_NOTIFY_ON_FAILURE((state_ == kStopped || state_ == kNormal),
"Failed to process output. Unexpected decoder state: " << state_,
PLATFORM_FAILURE,);
hr = decoder_->ProcessInput(0, sample, 0);
}
RETURN_AND_NOTIFY_ON_HR_FAILURE(hr, "Failed to process input sample", RETURN_AND_NOTIFY_ON_HR_FAILURE(hr, "Failed to process input sample",
PLATFORM_FAILURE,); PLATFORM_FAILURE,);
......
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