Bug 1194612: P2. Don't drop first sample with SPS/PPS NALs. r=alfredo
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 14 Aug 2015 21:12:47 +1000
changeset 257966 1d342107d552d8e884fd8c3e4d9db03440accf40
parent 257965 cece40578641f81308201221d56a68345f410149
child 257967 52145910f5b602dc0bb807e9d417db34b5e4b30e
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: P2. Don't drop first sample with SPS/PPS NALs. r=alfredo It would cause the Apple VT decoder to fail decoding the frame, aborting playback
dom/media/platforms/wrappers/H264Converter.cpp
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -160,16 +160,19 @@ H264Converter::CreateDecoderAndInit(Medi
     return NS_ERROR_NOT_INITIALIZED;
   }
   UpdateConfigFromExtraData(extra_data);
 
   nsresult rv = CreateDecoder();
 
   if (NS_SUCCEEDED(rv)) {
     mDecoderInitializing = true;
+    // Queue the incoming sample.
+    mMediaRawSamples.AppendElement(aSample);
+
     nsRefPtr<H264Converter> self = this;
 
     // The mVideoTaskQueue is flushable which can't be used in MediaPromise. So
     // we get the current AbstractThread instead of it. The MOZ_ASSERT above
     // ensures we are running in AbstractThread so we won't get a nullptr.
     mInitPromiseRequest.Begin(mDecoder->Init()
       ->Then(AbstractThread::GetCurrent(), __func__, this,
              &H264Converter::OnDecoderInitDone,