Bug 1138229 - GetOutputStreamInfo() after each SetOutputType(). r=cpearce, a=lsblakk
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 26 Feb 2015 17:59:37 +1300
changeset 250349 14cc1f92c84c
parent 250348 916424218be4
child 250350 0cd4e38e00b1
push id4555
push userryanvm@gmail.com
push date2015-03-11 19:14 +0000
treeherdermozilla-beta@7949e470a547 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce, lsblakk
bugs1138229
milestone37.0
Bug 1138229 - GetOutputStreamInfo() after each SetOutputType(). r=cpearce, a=lsblakk
dom/media/fmp4/wmf/MFTDecoder.cpp
--- a/dom/media/fmp4/wmf/MFTDecoder.cpp
+++ b/dom/media/fmp4/wmf/MFTDecoder.cpp
@@ -57,21 +57,16 @@ MFTDecoder::SetMediaTypes(IMFMediaType* 
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   hr = SetDecoderOutputType();
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   hr = mDecoder->GetInputStreamInfo(0, &mInputStreamInfo);
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
-  hr = mDecoder->GetOutputStreamInfo(0, &mOutputStreamInfo);
-  NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
-
-  mMFTProvidesOutputSamples = IsFlagSet(mOutputStreamInfo.dwFlags, MFT_OUTPUT_STREAM_PROVIDES_SAMPLES);
-
   hr = SendMFTMessage(MFT_MESSAGE_NOTIFY_BEGIN_STREAMING, 0);
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   hr = SendMFTMessage(MFT_MESSAGE_NOTIFY_START_OF_STREAM, 0);
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   return S_OK;
 }
@@ -96,16 +91,22 @@ MFTDecoder::SetDecoderOutputType()
   RefPtr<IMFMediaType> outputType;
   UINT32 typeIndex = 0;
   while (SUCCEEDED(mDecoder->GetOutputAvailableType(0, typeIndex++, byRef(outputType)))) {
     BOOL resultMatch;
     hr = mOutputType->Compare(outputType, MF_ATTRIBUTES_MATCH_OUR_ITEMS, &resultMatch);
     if (SUCCEEDED(hr) && resultMatch == TRUE) {
       hr = mDecoder->SetOutputType(0, outputType, 0);
       NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
+
+      hr = mDecoder->GetOutputStreamInfo(0, &mOutputStreamInfo);
+      NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
+
+      mMFTProvidesOutputSamples = IsFlagSet(mOutputStreamInfo.dwFlags, MFT_OUTPUT_STREAM_PROVIDES_SAMPLES);
+
       return S_OK;
     }
     outputType = nullptr;
   }
   return E_FAIL;
 }
 
 HRESULT