Bug 1207021: [mp4] Properly set dts on plain mp4 media. r=edwin

This commit is contained in:
Jean-Yves Avenard 2015-09-22 14:37:58 +10:00
parent ae89c81f63
commit 2db6646363
5 changed files with 7 additions and 1 deletions

View File

@ -255,6 +255,7 @@ Index::Index(const nsTArray<Indice>& aIndex,
indice.end_offset);
sample.mCompositionRange = Interval<Microseconds>(indice.start_composition,
indice.end_composition);
sample.mDecodeTime = indice.start_decode;
sample.mSync = indice.sync;
// FIXME: Make this infallible after bug 968520 is done.
MOZ_ALWAYS_TRUE(mIndex.AppendElement(sample, fallible));

View File

@ -81,6 +81,7 @@ ConvertIndex(FallibleTArray<Index::Indice>& aDest,
indice.end_offset = s_indice.end_offset;
indice.start_composition = s_indice.start_composition - aMediaTime;
indice.end_composition = s_indice.end_composition - aMediaTime;
indice.start_decode = s_indice.start_decode;
indice.sync = s_indice.sync;
// FIXME: Make this infallible after bug 968520 is done.
MOZ_ALWAYS_TRUE(aDest.AppendElement(indice, mozilla::fallible));

View File

@ -51,6 +51,7 @@ public:
uint64_t end_offset;
uint64_t start_composition;
uint64_t end_composition;
uint64_t start_decode;
bool sync;
};

View File

@ -116,6 +116,7 @@ struct MediaSource : public virtual RefBase {
uint64_t end_offset;
uint64_t start_composition;
uint64_t end_composition;
uint64_t start_decode;
bool sync;
};

View File

@ -4258,9 +4258,10 @@ nsTArray<MediaSource::Indice> MPEG4Source::exportIndex()
uint32_t compositionTime;
uint32_t duration;
bool isSyncSample;
uint32_t decodeTime;
if (mSampleTable->getMetaDataForSample(sampleIndex, &offset, &size,
&compositionTime, &duration,
&isSyncSample) != OK) {
&isSyncSample, &decodeTime) != OK) {
ALOGE("Unexpected sample table problem");
continue;
}
@ -4274,6 +4275,7 @@ nsTArray<MediaSource::Indice> MPEG4Source::exportIndex()
indice.end_composition =
(compositionTime * 1000000ll + duration * 1000000ll) / mTimescale;
indice.sync = isSyncSample;
indice.start_decode = (decodeTime * 1000000ll) / mTimescale;
index.AppendElement(indice);
}