mirror of
https://github.com/androidx/media.git
synced 2025-05-06 23:20:42 +08:00

While the timeline is empty, we keep a dummy MediaPeriodId in PlaybackInfo with a period index of 0. We leak this MediaPeriodId in actual use in these situations: 1. When issuing an IllegalSeekPosition after preparation. The timeline becomes non-empty, but the media period id stays at its dummy value. 2. When re-adding sources to a previously empty timeline. The dummy period id is used as the start position for the new non-empty timeline. This change makes: - the constructor of PlaybackInfo using those dummy values more explicit - prevents the issues above by using the correct default position in the new non-empty timeline for the above mentioned cases. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=205803006