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
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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,
+1 −0
Original line number Diff line number Diff line
@@ -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.