dashenc: Reduce the segment duration if cutting out parts with edit lists

This makes sure that the time + duration of the first segment
matches the start time of the next segment for e.g. AAC audio
with encoder delay.

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2015-05-10 10:05:37 +03:00
parent ac1a1cb948
commit b8d2630c53
1 changed files with 4 additions and 2 deletions

View File

@ -696,9 +696,11 @@ static int add_segment(OutputStream *os, const char *file,
return AVERROR(ENOMEM);
av_strlcpy(seg->file, file, sizeof(seg->file));
seg->time = time;
if (seg->time < 0) // If pts<0, it is expected to be cut away with an edit list
seg->time = 0;
seg->duration = duration;
if (seg->time < 0) { // If pts<0, it is expected to be cut away with an edit list
seg->duration += seg->time;
seg->time = 0;
}
seg->start_pos = start_pos;
seg->range_length = range_length;
seg->index_length = index_length;