mirror of
https://github.com/androidx/media.git
synced 2025-05-04 14:10:40 +08:00

Before this change we would reset the start trim to zero after initial configuration (at the start of playback) and after seeking to any position. The fact that no trimming was applied at the start of playback meant that after the first period transition we'd see a mismatch between the next buffer timestamp (equal to the duration of the period taking into account edits) and the duration of audio submitted to the sink. This change modifies the behavior so that we reset the start trim to zero only if some audio was queued since configuration. This is incorrect in the case of starting playback at a non-zero position, but fixes the common case of starting at zero. As before, a later seek to any position is handled via a flush and resets the trim as required. Transitions from one period to the next are unaffected by this change. One way to implement start trimming correctly would be to provide the input buffer timestamp to the audio processors and only trim when handling audio from the start of the stream, but that is a larger change so left for later. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=213828511
ExoPlayer library
The ExoPlayer library is split into multiple modules. See ExoPlayer's top level README for more information about the available library modules and how to use them.