mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

The C2 MP3 decoder produces an extra output buffer when draining after end-of-stream is queued. This output buffer has a later timestamp than the last queued input buffer so we need to calculate its timestamp to detect a stream change in the correct position. Before this CL we used the original input buffer timestamp as the largest queued timestamp, which caused the stream change to be detected at the correct position because the original input buffer timestamp was slightly larger than the actual last output buffer timestamp. After this change we use exact calculated timestamp as the largest queued timestamp. I manually verified gapless continues to work on a device using the C2 MP3 decoder by comparing output of the MP3 gapless and MP3 gapless stripped playlists in the demo app, and that the last buffer timestamp now matches. #exofixit PiperOrigin-RevId: 395428928