Bug 1254311: [mp4] Ignore empty raw sample. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 08 Mar 2016 21:48:38 +1100
changeset 287373 2d9cb763754d01143f160ff7c859b135dd2201f4
parent 287372 2a063b30fd4a287519b350f83c0ee5054a3d30ef
child 287374 d5b703a8210f22809087feea1d0df54b70749a44
push id73159
push userjyavenard@mozilla.com
push dateWed, 09 Mar 2016 02:35:12 +0000
treeherdermozilla-inbound@d5b703a8210f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1254311
milestone48.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 1254311: [mp4] Ignore empty raw sample. r=cpearce Some decoders (wmf) will return an error if fed an empty sample. MozReview-Commit-ID: 2FF0cy41zYV
dom/media/fmp4/MP4Demuxer.cpp
--- a/dom/media/fmp4/MP4Demuxer.cpp
+++ b/dom/media/fmp4/MP4Demuxer.cpp
@@ -297,16 +297,19 @@ MP4TrackDemuxer::GetSamples(int32_t aNum
 
   if (mQueuedSample) {
     samples->mSamples.AppendElement(mQueuedSample);
     mQueuedSample = nullptr;
     aNumSamples--;
   }
   RefPtr<MediaRawData> sample;
   while (aNumSamples && (sample = mIterator->GetNext())) {
+    if (!sample->Size()) {
+      continue;
+    }
     samples->mSamples.AppendElement(sample);
     aNumSamples--;
   }
 
   if (samples->mSamples.IsEmpty()) {
     return SamplesPromise::CreateAndReject(DemuxerFailureReason::END_OF_STREAM, __func__);
   } else {
     UpdateSamples(samples->mSamples);