bug 1304994 - resubmit input data when MFT returns MF_E_NOTACCEPTING. draft
authorAlastor Wu <alwu@mozilla.com>
Wed, 11 Jan 2017 11:10:10 +0800
changeset 458820 526f10240ba0ab2fafd052bc65ad969c367126b4
parent 457446 d192a99be4b436f2dc839435319f7630d5d8f4b0
child 464921 9b7a2c60e0cb269a1e827a140fd5162e69273d15
push id41073
push useralwu@mozilla.com
push dateWed, 11 Jan 2017 03:10:36 +0000
bugs1304994
milestone53.0a1
bug 1304994 - resubmit input data when MFT returns MF_E_NOTACCEPTING. When MFT returns MF_E_NOTACCEPTING means the input buffer is full and it can't accept input data anymore, so we need to output the data first and then resummit the input data. MozReview-Commit-ID: DfSTASsEX7r
dom/media/platforms/wmf/WMFMediaDataDecoder.cpp
--- a/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp
+++ b/dom/media/platforms/wmf/WMFMediaDataDecoder.cpp
@@ -116,16 +116,23 @@ void
 WMFMediaDataDecoder::ProcessDecode(MediaRawData* aSample)
 {
   if (mIsFlushing) {
     // Skip sample, to be released by runnable.
     return;
   }
 
   HRESULT hr = mMFTManager->Input(aSample);
+  if (hr == MF_E_NOTACCEPTING) {
+    while (hr != MF_E_NOTACCEPTING) {
+      ProcessOutput();
+      hr = mMFTManager->Input(aSample);
+    }
+  }
+
   if (FAILED(hr)) {
     NS_WARNING("MFTManager rejected sample");
     mCallback->Error(MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR,
                                  RESULT_DETAIL("MFTManager::Input:%x", hr)));
     if (!mRecordedError) {
       SendTelemetry(hr);
       mRecordedError = true;
     }