Bug 1246536: [webm] Only use discard padding information on last packet. r?kinetik
MozReview-Commit-ID: 3MYm25HfX0N
--- a/dom/media/webm/WebMDemuxer.cpp
+++ b/dom/media/webm/WebMDemuxer.cpp
@@ -577,17 +577,17 @@ WebMDemuxer::GetNextPacket(TrackInfo::Tr
WEBM_DEBUG("push sample tstamp: %ld next_tstamp: %ld length: %ld kf: %d",
tstamp, next_tstamp, length, isKeyframe);
RefPtr<MediaRawData> sample = new MediaRawData(data, length);
sample->mTimecode = tstamp;
sample->mTime = tstamp;
sample->mDuration = next_tstamp - tstamp;
sample->mOffset = holder->Offset();
sample->mKeyframe = isKeyframe;
- if (discardPadding) {
+ if (discardPadding && i == count - 1) {
uint8_t c[8];
BigEndian::writeInt64(&c[0], discardPadding);
sample->mExtraData = new MediaByteBuffer;
sample->mExtraData->AppendElements(&c[0], 8);
}
aSamples->Push(sample);
}
return true;