Skip to content

ExoPlayer in ForwardingSimpleBasePlayer triggers multiple asserts #2674

@nift4

Description

@nift4

Version

Media3 main branch

More version details

bd2b1a4

Devices that reproduce the issue

Android 16 emulator

Devices that do not reproduce the issue

N/A

Reproducible in the demo app?

Not tested

Reproduction steps

  1. Wrap ExoPlayer in ForwardingSimpleBasePlayer
  2. Play a file ExoPlayer cannot process (i.e. SID file Rapid_Fire.sid.zip)
  3. Play another file ExoPlayer does support

Expected result

it works

Actual result

Caused by: java.lang.IllegalArgumentException: Player error only allowed in STATE_IDLE
                                                                                                     at androidx.media3.common.util.Assertions.checkArgument(Assertions.java:55)
                                                                                                     at androidx.media3.common.SimpleBasePlayer$State.<init>(SimpleBasePlayer.java:1048)
                                                                                                     at androidx.media3.common.SimpleBasePlayer$State.<init>(SimpleBasePlayer.java:99)
                                                                                                     at androidx.media3.common.SimpleBasePlayer$State$Builder.build(SimpleBasePlayer.java:827)
                                                                                                     at androidx.media3.common.ForwardingSimpleBasePlayer.getState(ForwardingSimpleBasePlayer.java:187)
                                                                                                     at org.akanework.gramophone.logic.utils.exoplayer.EndedWorkaroundPlayer.getState(EndedWorkaroundPlayer.kt:66)
                                                                                                     at androidx.media3.common.SimpleBasePlayer.updateStateForPendingOperation(SimpleBasePlayer.java:3878)
                                                                                                     at androidx.media3.common.SimpleBasePlayer.updateStateForPendingOperation(SimpleBasePlayer.java:3864)
                                                                                                     at androidx.media3.common.SimpleBasePlayer.setMediaItemsInternal(SimpleBasePlayer.java:2313)
                                                                                                     at androidx.media3.common.SimpleBasePlayer.setMediaItems(SimpleBasePlayer.java:2300)
                                                                                                     at androidx.media3.common.ForwardingPlayer.setMediaItems(ForwardingPlayer.java:111)
                                                                                                     at androidx.media3.session.PlayerWrapper.setMediaItems(PlayerWrapper.java:370)

And this is not the only assert I was able to trigger in a short amount of time, I sent a PR for another one here: #2673

Media

see above

Bug Report

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions