summaryrefslogtreecommitdiffstats
path: root/content/common
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-14 17:37:00 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-14 17:37:00 +0000
commit3b1a548f2d3a6b78faa99549de72745542461fd2 (patch)
treebaf7f90f560b46633c9ec6de3585bdfc5ae3e987 /content/common
parent1f73d5478f1a940cefb256d1d6aef9694532fb65 (diff)
downloadchromium_src-3b1a548f2d3a6b78faa99549de72745542461fd2.zip
chromium_src-3b1a548f2d3a6b78faa99549de72745542461fd2.tar.gz
chromium_src-3b1a548f2d3a6b78faa99549de72745542461fd2.tar.bz2
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
Diffstat (limited to 'content/common')
-rw-r--r--content/common/gpu/media/dxva_video_decode_accelerator.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/content/common/gpu/media/dxva_video_decode_accelerator.cc b/content/common/gpu/media/dxva_video_decode_accelerator.cc
index e0265e3..11424ee 100644
--- a/content/common/gpu/media/dxva_video_decode_accelerator.cc
+++ b/content/common/gpu/media/dxva_video_decode_accelerator.cc
@@ -584,6 +584,21 @@ void DXVAVideoDecodeAccelerator::Decode(
inputs_before_decode_++;
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",
PLATFORM_FAILURE,);