mirror of
https://github.com/androidx/media.git
synced 2025-05-04 22:20:47 +08:00

The streams return end-of-input if they read no samples, but know that they are fully buffered to at least the clipped end time. This helps to detect the end of stream even if there are no new buffers after the end of the clip (e.g. for sparse metadata tracks). The race condition occurs because the buffered position is evaluated after reading the sample. So between reading "no sample" and checking the buffered position, the source may have loaded arbitrary amounts of data. This may lead to a situation where the source has not read all samples, reads NOTHING_READ (because the queue is empty) and then immediately returns end-of-stream (because the buffered position jumped forward), causing all remaining samples in the stream to be skipped. This can fixed by moving the buffered position check to before reading the sample, so that it never exceeds the buffered position at the time of reading "no sample". #minor-release PiperOrigin-RevId: 548646464 (cherry picked from commit c64d9fd6da90497547daf3deea536af2007784a5)
ExoPlayer module
This module provides ExoPlayer
, the Player
implementation for local media
playback on Android.
Getting the module
The easiest way to get the module is to add it as a gradle dependency:
implementation 'androidx.media3:media3-exoplayer:1.X.X'
where 1.X.X
is the version, which must match the version of the other media
modules being used.
Alternatively, you can clone this GitHub project and depend on the module locally. Instructions for doing this can be found in the top level README.