Skip to content

Commit

Permalink
Correctly offset subsample timestamps.
Browse files Browse the repository at this point in the history
This has always been broken in V2, but the issue is now also
visible for the very first period in the timeline because we
offset if by 60s. Previously the issue would only have been
visible from the start of the second period.

Issue: #2208

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=142252702
  • Loading branch information
ojw28 authored and Oliver Woodman committed Dec 19, 2016
1 parent a6360ab commit ada19a2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ protected final int readSource(FormatHolder formatHolder, DecoderInputBuffer buf
return streamIsFinal ? C.RESULT_BUFFER_READ : C.RESULT_NOTHING_READ;
}
buffer.timeUs += streamOffsetUs;
} else if (result == C.RESULT_FORMAT_READ) {
Format format = formatHolder.format;
if (format.subsampleOffsetUs != Format.OFFSET_SAMPLE_RELATIVE) {
format = format.copyWithSubsampleOffsetUs(format.subsampleOffsetUs + streamOffsetUs);
formatHolder.format = format;
}
}
return result;
}
Expand Down

0 comments on commit ada19a2

Please sign in to comment.