Fix HLS load position reset when upstream chunks are discarded
When resuming HLS low-latency playback after a temporary playlist load failure, if a full segment is available on the server and its `#EXT-X-PART` tags are removed from the playlist, `getChunkPublicationState` marks the buffered partial chunks as `CHUNK_PUBLICATION_STATE_REMOVED`. In `discardUpstream`, purging all partial chunks when `mediaChunks.isEmpty()` resets `pendingResetPositionUs` directly to `lastSeekPositionUs` (e.g. 60s earlier). The `HlsChunkSource` would refill the buffer from that old position, triggering an unexpected audio track timestamp discontinuity exception in `DefaultAudioSink`. By assigning `pendingResetPositionUs = max(lastSeekPositionUs, firstRemovedChunk.startTimeUs)`, we ensure ExoPlayer reloads from the start time of the removed upstream chunk while protecting against post-seek keyframe snapping (`max`). #cherrypick Issue: androidx/media#3311 PiperOrigin-RevId: 947616837 (cherry picked from commit b842f19baeaa2f6add0b4b559cacf9979209f776)
T
tianyifeng committed
7745e47713505609a594d5355426b84d0f679c69
Parent: 0d0fcbd