Fix incorrect data_reference_index in TextSampleEntry

In the text sample box (for mp4) there was a value called
"data_reference_index" that was never initialized. This meant
that it took on various values can caused different results
between runs.

Change-Id: I4b18ac97ec4700f6e651b14898ef250713a4253c
This commit is contained in:
Aaron Vaage 2018-05-25 09:04:46 -07:00
parent d7dcf9c7c7
commit cf3fc61fbe
2 changed files with 5 additions and 1 deletions

View File

@ -1895,7 +1895,10 @@ size_t WebVTTSourceLabelBox::ComputeSizeInternal() {
return HeaderSize() + source_label.size(); return HeaderSize() + source_label.size();
} }
TextSampleEntry::TextSampleEntry() : format(FOURCC_NULL) {} // data_reference_index is 1-based and "dref" box is mandatory so it is
// always present.
TextSampleEntry::TextSampleEntry()
: format(FOURCC_NULL), data_reference_index(1u) {}
TextSampleEntry::~TextSampleEntry() {} TextSampleEntry::~TextSampleEntry() {}
FourCC TextSampleEntry::BoxType() const { FourCC TextSampleEntry::BoxType() const {

View File

@ -377,6 +377,7 @@ struct TextSampleEntry : Box {
// set to 'wvtt' to write WVTTSampleEntry; On read, it is recovered from box // set to 'wvtt' to write WVTTSampleEntry; On read, it is recovered from box
// header. // header.
FourCC format; FourCC format;
uint16_t data_reference_index; uint16_t data_reference_index;
// Sub boxes for wvtt text sample entry. // Sub boxes for wvtt text sample entry.