You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I found the following crash report on Crashlytics. An exception thrown inside of the MediaControllerImplBase.onPlayerInfoChanged().
(Click here to display the full stacktrace)
Fatal Exception: java.lang.IndexOutOfBoundsException: index (*) must be less than size (*)
Example 1
Fatal Exception: java.lang.IndexOutOfBoundsException: index (4) must be less than size (4)
at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1355)
at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1337)
at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:82)
at androidx.media3.common.Timeline$RemotableTimeline.getWindow(Timeline.java:1530)
at androidx.media3.common.Timeline.getWindow(Timeline.java:1118)
at androidx.media3.session.PlayerInfo.getCurrentMediaItem(PlayerInfo.java:637)
at androidx.media3.session.MediaControllerImplBase.onPlayerInfoChanged(MediaControllerImplBase.java:2383)
at androidx.media3.session.MediaControllerStub.lambda$onPlayerInfoChanged$9(MediaControllerStub.java:180)
at androidx.media3.session.MediaControllerStub.$r8$lambda$X59hShI5lo8-62FDwGBWO2tdQfo(MediaControllerStub.java)
at androidx.media3.session.MediaControllerStub$$InternalSyntheticLambda$2$4a3a6820449623629e404f4bef3c0240e0815b9ab568a3a89e0663d3f4d5622f$0.run(MediaControllerStub.java:4)
at androidx.media3.session.MediaControllerStub.lambda$dispatchControllerTaskOnHandler$12(MediaControllerStub.java:271)
at androidx.media3.session.MediaControllerStub.$r8$lambda$YGpG-xpiKgSpdH847m1pEUdLemY(MediaControllerStub.java)
at androidx.media3.session.MediaControllerStub$$InternalSyntheticLambda$3$c38f624292a1f1ed4af00152f20c76bcf37ccebfce0326ec339c89e37f90a1b6$0.run(MediaControllerStub.java:4)
at androidx.media3.common.util.Util.postOrRun(Util.java:528)
at androidx.media3.session.MediaControllerStub.dispatchControllerTaskOnHandler(MediaControllerStub.java:263)
at androidx.media3.session.MediaControllerStub.onPlayerInfoChanged(MediaControllerStub.java:178)
at androidx.media3.session.MediaSessionStub$Controller2Cb.onPlayerInfoChanged(MediaSessionStub.java:1734)
at androidx.media3.session.MediaSessionImpl.dispatchOnPlayerInfoChanged(MediaSessionImpl.java:393)
at androidx.media3.session.MediaSessionImpl.access$600(MediaSessionImpl.java:80)
at androidx.media3.session.MediaSessionImpl$PlayerInfoChangedHandler.handleMessage(MediaSessionImpl.java:1186)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8653)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Example 2
Fatal Exception: java.lang.IndexOutOfBoundsException: index (13) must be less than size (1)
at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1355)
at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1337)
at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:82)
at androidx.media3.common.Timeline$RemotableTimeline.getWindow(Timeline.java:1530)
at androidx.media3.common.Timeline.getWindow(Timeline.java:1118)
at androidx.media3.session.PlayerInfo.getCurrentMediaItem(PlayerInfo.java:637)
at androidx.media3.session.MediaControllerImplBase.onPlayerInfoChanged(MediaControllerImplBase.java:2383)
at androidx.media3.session.MediaControllerStub.lambda$onPlayerInfoChanged$9(MediaControllerStub.java:180)
at androidx.media3.session.MediaControllerStub.$r8$lambda$X59hShI5lo8-62FDwGBWO2tdQfo(MediaControllerStub.java)
at androidx.media3.session.MediaControllerStub$$InternalSyntheticLambda$2$4a3a6820449623629e404f4bef3c0240e0815b9ab568a3a89e0663d3f4d5622f$0.run(MediaControllerStub.java:4)
at androidx.media3.session.MediaControllerStub.lambda$dispatchControllerTaskOnHandler$12(MediaControllerStub.java:271)
at androidx.media3.session.MediaControllerStub.$r8$lambda$YGpG-xpiKgSpdH847m1pEUdLemY(MediaControllerStub.java)
at androidx.media3.session.MediaControllerStub$$InternalSyntheticLambda$3$c38f624292a1f1ed4af00152f20c76bcf37ccebfce0326ec339c89e37f90a1b6$0.run(MediaControllerStub.java:4)
at androidx.media3.common.util.Util.postOrRun(Util.java:528)
at androidx.media3.session.MediaControllerStub.dispatchControllerTaskOnHandler(MediaControllerStub.java:263)
at androidx.media3.session.MediaControllerStub.onPlayerInfoChanged(MediaControllerStub.java:178)
at androidx.media3.session.MediaSessionStub$Controller2Cb.onPlayerInfoChanged(MediaSessionStub.java:1734)
at androidx.media3.session.MediaSessionImpl.dispatchOnPlayerInfoChanged(MediaSessionImpl.java:393)
at androidx.media3.session.MediaSessionImpl.access$600(MediaSessionImpl.java:80)
at androidx.media3.session.MediaSessionImpl$PlayerInfoChangedHandler.handleMessage(MediaSessionImpl.java:1186)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6819)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:497)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:912)
Library versions
androidx.media3: Built from source (Commit ID: f92ae23)
Affected devices
Samsung Galaxy S22 Ultra (Android 12)
Samsung Galaxy A71 (Android 11)
Infinix Smart 4 (Android 9)
and many more...
How to reproduce the issue?
Sorry, I have not succeeded in reproducing the issue yet. I'll post details if I can get any info.
The text was updated successfully, but these errors were encountered:
This fixes an inconsistent state of the `PlayerInfo` when the index of the playing
media item is changed by a playlist modification. In this inconsistent state,
calling `Playerinfo.getCurrentMediaItem` can produce an
`ArrayIndexOutOfBoundException` (see stack trace in GH issue).
This change takes the following measurements:
- always update sessionPosition and timeline of the PlayerInfo together in
`MediaSessionImpl.PlayerListener` where the PlayerInfo originates from
- add an assertion to avoid building a `PlayerInfo` instance in an inconsistent
state
- reduce the window of opportunity for concurrent access to
`mediaSessionImpl.playerInfo` when dispatching player info changes in
`MediaSessionImpl`
Issue: #51
PiperOrigin-RevId: 444812661
Hi. I found the following crash report on Crashlytics. An exception thrown inside of the
MediaControllerImplBase.onPlayerInfoChanged()
.(Click here to display the full stacktrace)
Example 1
Example 2
Library versions
androidx.media3
: Built from source (Commit ID: f92ae23)Affected devices
How to reproduce the issue?
Sorry, I have not succeeded in reproducing the issue yet. I'll post details if I can get any info.
The text was updated successfully, but these errors were encountered: