Bug 1374774: P4. Correct H264 telemetry reporting. r=gerald a=jcristau
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 22 Jun 2017 14:52:07 +0200
changeset 414372 00bd2e527ae04e054b0bff0ba82c645dceee8cec
parent 414371 ffcb435fd7b3facfcfe85de7ff07030e646a864c
child 414373 aa9660e02f665d87d02bab05e85209ef1ec5c2d0
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, jcristau
bugs1374774
milestone55.0
Bug 1374774: P4. Correct H264 telemetry reporting. r=gerald a=jcristau The code couldn't have worked, mNeedSPSForTelemetry can only be set if we didn't get an H264 extradata in the MP4 metadata. So any calls to HasSPS(sample->mExtraData) would have always returned false. MozReview-Commit-ID: 3PcRXJHBJyC
dom/media/fmp4/MP4Demuxer.cpp
--- a/dom/media/fmp4/MP4Demuxer.cpp
+++ b/dom/media/fmp4/MP4Demuxer.cpp
@@ -515,20 +515,24 @@ MP4TrackDemuxer::GetSamples(int32_t aNum
   }
 
   if (samples->mSamples.IsEmpty()) {
     return SamplesPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_END_OF_STREAM,
                                            __func__);
   }
   for (const auto& sample : samples->mSamples) {
     // Collect telemetry from h264 Annex B SPS.
-    if (mNeedSPSForTelemetry && mp4_demuxer::H264::HasSPS(sample->mExtraData)) {
+    if (mNeedSPSForTelemetry) {
       RefPtr<MediaByteBuffer> extradata =
         mp4_demuxer::H264::ExtractExtraData(sample);
-      mNeedSPSForTelemetry = AccumulateSPSTelemetry(extradata);
+      if (mp4_demuxer::H264::HasSPS(extradata)) {
+        RefPtr<MediaByteBuffer> extradata =
+          mp4_demuxer::H264::ExtractExtraData(sample);
+        mNeedSPSForTelemetry = AccumulateSPSTelemetry(extradata);
+      }
     }
   }
 
   if (mNextKeyframeTime.isNothing()
       || samples->mSamples.LastElement()->mTime
       >= mNextKeyframeTime.value()) {
     SetNextKeyFrameTime();
   }