Generate sidx box only if there are more than one entries

Change-Id: If7d7440f18e8b50a3261e18138b1a40bd754aba7
This commit is contained in:
KongQun Yang 2014-07-17 17:27:05 -07:00
parent 3e6190ec2b
commit 05db9e02b9
1 changed files with 3 additions and 2 deletions

View File

@ -158,8 +158,9 @@ Status MultiSegmentSegmenter::WriteSegment() {
styp_->Write(buffer.get());
}
// If num_subsegments_per_sidx is negative, no SIDX box is generated.
if (options().num_subsegments_per_sidx >= 0)
// Generate sidx box only if |num_subsegments_per_sidx| is non-negative and
// the box contains multiple entries.
if (options().num_subsegments_per_sidx >= 0 && sidx()->references.size() > 1)
sidx()->Write(buffer.get());
const size_t segment_size = buffer->Size() + fragment_buffer()->Size();