diff --git a/packager/media/formats/mp4/box_definitions.cc b/packager/media/formats/mp4/box_definitions.cc index f28e287244..87a236d2b1 100644 --- a/packager/media/formats/mp4/box_definitions.cc +++ b/packager/media/formats/mp4/box_definitions.cc @@ -1895,7 +1895,10 @@ size_t WebVTTSourceLabelBox::ComputeSizeInternal() { 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() {} FourCC TextSampleEntry::BoxType() const { diff --git a/packager/media/formats/mp4/box_definitions.h b/packager/media/formats/mp4/box_definitions.h index 2c208594b0..a264eee185 100644 --- a/packager/media/formats/mp4/box_definitions.h +++ b/packager/media/formats/mp4/box_definitions.h @@ -377,6 +377,7 @@ struct TextSampleEntry : Box { // set to 'wvtt' to write WVTTSampleEntry; On read, it is recovered from box // header. FourCC format; + uint16_t data_reference_index; // Sub boxes for wvtt text sample entry.