Skip to content

Wrong progress is reported when using ConcatenatingMediaSource with playback speed that is not 1 #6117

Closed
@schyau

Description

Issue description

When using ConcatenatingMediaSource and playback speed is not 1, player.getCurrentPosition() reports the wrong value. It happens when transitioning into the next audio. It starts by first reporting a nonzero number at the start of audio, then repeating this same number until the real-life audio progress catches up to that number. When that happens getCurrentPosition will start reporting correctly.

for example:
If track 1 finishes playing, track 2 will start playing and it should start by reporting 0 when player.getCurrentPosition() is called, but instead it reports 2000. 2000 is repeatedly reported until 2000 ms of playback has elapsed in real life for track 2, and then the player will start reporting correctly every time it gets polled again (until the next track).

Other notes:

  • this is an audio only app
  • the problem exists if playback rate is not 1, (I tested using .75, 1.1, and 1.5)

Reproduction steps

Clone this repo, build, install, launch. Click the button to play. Then pay close attention to the TextView that reports progress. Specifically notice when the index increases, you'll see the bug very clearly when the progress stalls before picking back up. I see this bug (barely) when transitioning from index 0 to 1 (there's a ~1 sec stall) - it's really easy to miss. However, it is very apparent from index 1 to 2 (there's a ~5-45 sec stall). As more track transitions happen, the problems range from none to a lot. When the errors do happen, they are pretty consistent - ie: I am able to reproduce the errors at roughly the same track transitions.

btw, the content is slliiiightly NSFW, so I hope you are wearing earphones. (some context on why this content was chosen: I work for Audm, we hire professional voice actors to read articles. This was one of the more problematic articles that we ran into, unfortunately it is also one of the more provocative. To be fair, it's a pretty interesting read.)

My impl uses a SimpleExoPlayer instance and prepares a ConcatenatingMediaSource with 20 ProgressiveMediaSources (m4a audio from assets). The playback rate is set to 2.

Link to test content

Content is in assets

A full bug report captured from the device

bugreport-NYC-2019-07-01-22-45-55.zip

Version of ExoPlayer being used

2.10.2
interesting to note: this did not happen in 2.9.x

Device(s) and version(s) of Android being used

physical devices - Pixel 3a api28, Galaxy S9 api28
emulator - Pixel XL api28 and 25

reproducible all the time.

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions