Skip to content
Snippets Groups Projects
Commit 787b689f authored by Chris Pearce's avatar Chris Pearce
Browse files

Bug 1207376 - Check whether H264Converter created its decoder successfully. r=jya

parent a3bf2b48
No related branches found
No related tags found
No related merge requests found
......@@ -242,12 +242,20 @@ PlatformDecoderModule::CreateDecoder(const TrackInfo& aConfig,
}
if (H264Converter::IsH264(aConfig)) {
m = new H264Converter(this,
nsRefPtr<H264Converter> h
= new H264Converter(this,
*aConfig.GetAsVideoInfo(),
aLayersBackend,
aImageContainer,
aTaskQueue,
callback);
const nsresult rv = h->GetLastError();
if (NS_SUCCEEDED(rv) || rv == NS_ERROR_NOT_INITIALIZED) {
// The H264Converter either successfully created the wrapped decoder,
// or there wasn't enough AVCC data to do so. Otherwise, there was some
// problem, for example WMF DLLs were missing.
m = h.forget();
}
} else if (!hasPlatformDecoder && VPXDecoder::IsVPX(aConfig.mMimeType)) {
m = new VPXDecoder(*aConfig.GetAsVideoInfo(),
aImageContainer,
......
......@@ -38,6 +38,7 @@ public:
// Return true if mimetype is H.264.
static bool IsH264(const TrackInfo& aConfig);
nsresult GetLastError() const { return mLastError; }
private:
// Will create the required MediaDataDecoder if need AVCC and we have a SPS NAL.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment