зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1400537 - P1. Don't assume that the PDM will properly report an error. r=alwu
Only the Windows H264 decoder supports CreateDecoderParam::mError, all the other PDM leave the value untouched. As such, it can't be assumed that in case of failure, the mError attribute will be set. MozReview-Commit-ID: GWHGP6Wv3fl --HG-- extra : rebase_source : 081b71c7a53c41d9a13904e4182e3cfdb876ae43
This commit is contained in:
Родитель
1880a2c631
Коммит
3e790e2a55
|
@ -267,6 +267,7 @@ H264Converter::CreateDecoder(const VideoInfo& aConfig,
|
||||||
RESULT_DETAIL("Invalid SPS NAL."));
|
RESULT_DETAIL("Invalid SPS NAL."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MediaResult error = NS_OK;
|
||||||
mDecoder = mPDM->CreateVideoDecoder({
|
mDecoder = mPDM->CreateVideoDecoder({
|
||||||
aConfig,
|
aConfig,
|
||||||
mTaskQueue,
|
mTaskQueue,
|
||||||
|
@ -277,14 +278,17 @@ H264Converter::CreateDecoder(const VideoInfo& aConfig,
|
||||||
mType,
|
mType,
|
||||||
mOnWaitingForKeyEvent,
|
mOnWaitingForKeyEvent,
|
||||||
mDecoderOptions,
|
mDecoderOptions,
|
||||||
&mLastError
|
&error
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!mDecoder) {
|
if (!mDecoder) {
|
||||||
MOZ_ASSERT(NS_FAILED(mLastError));
|
if (NS_FAILED(error)) {
|
||||||
return MediaResult(mLastError.Code(),
|
// The decoder supports CreateDecoderParam::mError, returns the value.
|
||||||
RESULT_DETAIL("Unable to create H264 decoder, reason = %s.",
|
return error;
|
||||||
mLastError.Description().get()));
|
} else {
|
||||||
|
return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
|
||||||
|
RESULT_DETAIL("Unable to create H264 decoder"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mNeedKeyframe = true;
|
mNeedKeyframe = true;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче