Bug 1194612: P1. Dont reject init promise when initialising H264Converter. r=alfredo
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 14 Aug 2015 18:48:51 +1000
changeset 257965 cece40578641f81308201221d56a68345f410149
parent 257964 37dbde3bfc1bf354916ad4955ee58cca4f16161c
child 257966 1d342107d552d8e884fd8c3e4d9db03440accf40
push id29238
push userryanvm@gmail.com
push dateMon, 17 Aug 2015 13:06:57 +0000
treeherdermozilla-central@a6eeb28458fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersalfredo
bugs1194612
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1194612: P1. Dont reject init promise when initialising H264Converter. r=alfredo A decoder isn't created until a SPS and PPS NALs have been detected in the stream. The decoder will be initialised instead lazily later during the input process.
dom/media/platforms/wrappers/H264Converter.cpp
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -41,18 +41,19 @@ H264Converter::~H264Converter()
 
 nsRefPtr<MediaDataDecoder::InitPromise>
 H264Converter::Init()
 {
   if (mDecoder) {
     return mDecoder->Init();
   }
 
-  return MediaDataDecoder::InitPromise::CreateAndReject(
-           MediaDataDecoder::DecoderFailureReason::INIT_ERROR, __func__);
+  // We haven't been able to initialize a decoder due to a missing SPS/PPS.
+  return MediaDataDecoder::InitPromise::CreateAndResolve(
+           TrackType::kVideoTrack, __func__);
 }
 
 nsresult
 H264Converter::Input(MediaRawData* aSample)
 {
   if (!mNeedAVCC) {
     if (!mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample)) {
       return NS_ERROR_FAILURE;