Repository navigation
Unexpected exception handling load completed - java.lang.IndexOutOfBoundsException during Player re-prepare #10838
Copy link
Copy link
Closed
Labels
Description
ExoPlayer Version
2.18.1
Devices that reproduce the issue
Samsung Galaxy M31
OS Version 12
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
1)Play the Live content with SSAI enabled/multi-period and pause the playback
2) Resume the playback after few minutes(to say 8 mins or more).
Expected result
playback should recover from behindlivewindowexception and continues to play from the nearliveedge
Actual result
Exception During playback
LoadTask: Unexpected exception handling load completed
12-05 17:20:59.206 10829 29189 20310 E LoadTask: java.lang.IndexOutOfBoundsException: Index: 3, Size: 1
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at java.util.ArrayList.get(ArrayList.java:437)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.dash.manifest.DashManifest.getPeriod(DashManifest.java:126)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.dash.DashMediaSource.createPeriod(DashMediaSource.java:465)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.MaskingMediaPeriod.createPeriod(MaskingMediaPeriod.java:128)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.MaskingMediaSource.onChildSourceInfoRefreshed(MaskingMediaSource.java:203)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.MaskingMediaSource.onChildSourceInfoRefreshed(MaskingMediaSource.java:38)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.CompositeMediaSource.lambda$prepareChildSource$0$CompositeMediaSource(CompositeMediaSource.java:115)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.-$$Lambda$CompositeMediaSource$lU5TDdLYJk4FzgCLkUChati_nlA.onSourceInfoRefreshed(Unknown Source:4)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.BaseMediaSource.refreshSourceInfo(BaseMediaSource.java:88)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.dash.DashMediaSource.processManifest(DashMediaSource.java:847)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.dash.DashMediaSource.onUtcTimestampResolved(DashMediaSource.java:774)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.dash.DashMediaSource.onUtcTimestampLoadCompleted(DashMediaSource.java:676)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.dash.DashMediaSource$UtcTimestampCallback.onLoadCompleted(DashMediaSource.java:1330)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.source.dash.DashMediaSource$UtcTimestampCallback.onLoadCompleted(DashMediaSource.java:1325)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at com.google.android.exoplayer2.upstream.Loader$LoadTask.handleMessage(Loader.java:478)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at android.os.Handler.dispatchMessage(Handler.java:106)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at android.os.Looper.loopOnce(Looper.java:226)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at android.os.Looper.loop(Looper.java:313)
12-05 17:20:59.206 10829 29189 20310 E LoadTask: at android.os.HandlerThread.run(HandlerThread.java:67)
Media
Not Applicable
Bug Report
- You will email the zip file produced by
adb bugreportto dev.exoplayer@gmail.com after filing this issue.
Reactions are currently unavailable
Activity
marcbaechinger commentedon Dec 7, 2022
That's odd indeed.
Can you give me a bit more details how this can be reproduced?
From your description it sounds like you handle a
PlaybackExceptionand then you prepare the player again. Like something like this:Then this exception is thrown when the player is re-prepared. Is this correct?
It would be great to have a chance to repro this, so if you have a live stream that you can share with us, that would be super helpful. If you're unable to share bug reports or test content publicly, please send them to dev.exoplayer@gmail.com using a subject in the format "Issue #10838".
If it's not possible to send a stream, can you try whether you can avoid this exception by creating setting the source again in the case of the exception? Something like that instead of the above:
I have a hypothesis why this exception happens, and if you can avoid the exception with doing the above this would be a data point for me to dig some deeper there.
ValliKarunakaran commentedon Dec 8, 2022
thanks @marcbaechinger. As you mentioned, I added the mediasource to the player while re-preparing the player.
setMediaSource(liveSource)
It works fine. I did not get IndexOutOfBoundsException during player re-prepare.
Can I go ahead with the above fix and will it work for all streams during re-prepare?
marcbaechinger commentedon Dec 8, 2022
Yes, if that works I'm pretty sure it works reliably if you set a new media source.
However, we need to fix that on our end because it is not working as intended that an app needs to replace the media source.
Do not reset period uid when DashMediaSource is released
Do not reset period uid when DashMediaSource is released
Do not reset period uid when DashMediaSource is released
Do not reset period uid when DashMediaSource is released