Bug 1345545: Prepend SPS/PPS on first frame. r=jolin
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 08 Mar 2017 18:31:03 +0100
changeset 346711 195711551a793be1eb911329fc2e3f3345554c28
parent 346710 8d89f6b0b071fb6a915b49fc47ff4109ac7025f0
child 346712 c1eff365bec5fcd6d298599ec566853ff9c9c6c3
push id31478
push userkwierso@gmail.com
push dateFri, 10 Mar 2017 00:29:30 +0000
treeherdermozilla-central@fa55f8f56a1d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjolin
bugs1345545
milestone55.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 1345545: Prepend SPS/PPS on first frame. r=jolin MozReview-Commit-ID: 3UxVGjQcYtk
dom/media/platforms/wrappers/H264Converter.cpp
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -272,29 +272,31 @@ H264Converter::OnDecoderInitFailed(const
 
 void
 H264Converter::DecodeFirstSample(MediaRawData* aSample)
 {
   if (mNeedKeyframe && !aSample->mKeyframe) {
     mDecodePromise.Resolve(DecodedData(), __func__);
     return;
   }
-  mNeedKeyframe = false;
 
   mNeedAVCC =
     Some(mDecoder->NeedsConversion() == ConversionRequired::kNeedAVCC);
 
   if (!*mNeedAVCC
       && !mp4_demuxer::AnnexB::ConvertSampleToAnnexB(aSample, mNeedKeyframe)) {
     mDecodePromise.Reject(
       MediaResult(NS_ERROR_OUT_OF_MEMORY,
                   RESULT_DETAIL("ConvertSampleToAnnexB")),
       __func__);
     return;
   }
+
+  mNeedKeyframe = false;
+
   if (CanRecycleDecoder()) {
     mDecoder->ConfigurationChanged(mCurrentConfig);
   }
   RefPtr<H264Converter> self = this;
   mDecoder->Decode(aSample)
     ->Then(AbstractThread::GetCurrent()->AsTaskQueue(), __func__,
            [self, this](const MediaDataDecoder::DecodedData& aResults) {
              mDecodePromiseRequest.Complete();