Bug 1336873 - Force to crash if we get the the unexpected new output stream when receive MF_E_TRANSFORM_STREAM_CHANGE.
Force to crash can make us know whether that situation is the reason of the crash in bug1281835.
MozReview-Commit-ID: JVMzKxikwdH
--- a/dom/media/platforms/wmf/MFTDecoder.cpp
+++ b/dom/media/platforms/wmf/MFTDecoder.cpp
@@ -212,16 +212,23 @@ MFTDecoder::Output(RefPtr<IMFSample>* aO
if (output.pEvents) {
// We must release this, as per the IMFTransform::ProcessOutput()
// MSDN documentation.
output.pEvents->Release();
output.pEvents = nullptr;
}
if (hr == MF_E_TRANSFORM_STREAM_CHANGE) {
+ if (status == MFT_PROCESS_OUTPUT_STATUS_NEW_STREAMS) {
+ DWORD inputCount, outputCount;
+ mDecoder->GetStreamCount(&inputCount, &outputCount);
+ if (inputCount != outputCount) {
+ MOZ_CRASH("Got unexpected new output stream.");
+ }
+ }
// Type change, probably geometric aperture change.
// Reconfigure decoder output type, so that GetOutputMediaType()
// returns the new type, and return the error code to caller.
// This is an expected failure, so don't warn on encountering it.
hr = SetDecoderOutputType(nullptr, nullptr);
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
// Return the error, so that the caller knows to retry.
return MF_E_TRANSFORM_STREAM_CHANGE;