Correctly offset subsample timestamps.

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
This commit is contained in:
olly 2016-12-16 06:03:28 -08:00 committed by Oliver Woodman
parent a6360ab6c0
commit ada19a2540

View File

@ -267,6 +267,12 @@ public abstract class BaseRenderer implements Renderer, RendererCapabilities {
return streamIsFinal ? C.RESULT_BUFFER_READ : C.RESULT_NOTHING_READ; return streamIsFinal ? C.RESULT_BUFFER_READ : C.RESULT_NOTHING_READ;
} }
buffer.timeUs += streamOffsetUs; 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; return result;
} }