media icon indicating copy to clipboard operation
media copied to clipboard

DashManifest playback results in IndexOutOfBoundsException

Open JonWatson opened this issue 1 year ago • 1 comments

Version

Media3 1.2.1

More version details

No response

Devices that reproduce the issue

Bravia 4K GB(and other Bravia TVs) - Android versions 9-12 Hopper Plus - Android 11 Various other smart TVs - Android version 9-12 Google Chromecast TV - Android 12 Galaxy S20 FE 5G - Android 13

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

No response

Reproduction steps

Cannot reproduce, crash logs in Crashlytics

Expected result

Expect to play Dash manifest without crashes, even if there is an error

Actual result

Dash playback crashes on some devices

Fatal Exception: java.lang.IndexOutOfBoundsException: Index: 12, Size: 9 at java.util.ArrayList.get(ArrayList.java:437) at androidx.media3.exoplayer.dash.manifest.DashManifest.getPeriod(DashManifest.java:128) at androidx.media3.exoplayer.dash.DashMediaPeriod.(DashMediaPeriod.java:158) at androidx.media3.exoplayer.dash.DashMediaSource.createPeriod(DashMediaSource.java:609) at androidx.media3.exoplayer.source.MaskingMediaPeriod.createPeriod(MaskingMediaPeriod.java:131) at androidx.media3.exoplayer.source.MaskingMediaSource.onChildSourceInfoRefreshed(MaskingMediaSource.java:213) at androidx.media3.exoplayer.source.WrappingMediaSource.onChildSourceInfoRefreshed(WrappingMediaSource.java:154) at androidx.media3.exoplayer.source.WrappingMediaSource.onChildSourceInfoRefreshed(WrappingMediaSource.java:49) at androidx.media3.exoplayer.source.CompositeMediaSource.lambda$prepareChildSource$0(CompositeMediaSource.java:117) at androidx.media3.exoplayer.source.BaseMediaSource.refreshSourceInfo(BaseMediaSource.java:90) at androidx.media3.exoplayer.dash.DashMediaSource.processManifest(DashMediaSource.java:971) at androidx.media3.exoplayer.dash.DashMediaSource.onUtcTimestampResolutionError(DashMediaSource.java:905) at androidx.media3.exoplayer.dash.DashMediaSource.access$600(DashMediaSource.java:100) at androidx.media3.exoplayer.dash.DashMediaSource$1.onInitializationFailed(DashMediaSource.java:892) at androidx.media3.exoplayer.util.SntpClient$NtpTimeCallback.onLoadError(SntpClient.java:344) at androidx.media3.exoplayer.upstream.Loader$LoadTask.handleMessage(Loader.java:494) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at android.os.HandlerThread.run(HandlerThread.java:67)

Media

DRM protected private media

Bug Report

  • [ ] You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

JonWatson avatar Apr 29 '24 21:04 JonWatson

We fixed https://github.com/google/ExoPlayer/issues/10838 in Media3 1.2.0, which looks very similar. So just to double-check - you are seeing this on version Media3 1.2.1?

tonihei avatar May 13 '24 16:05 tonihei

I found the likely reason for this issue that still exists even after the linked bug was fixed. The linked issue only fixed it for immediate player.prepare() calls after an exception. But if the new playback attempt happens at a later point, this problem can still happen.

tonihei avatar May 16 '24 14:05 tonihei

Hi @tonihei , sorry for the late response but yes we are on 1.2.1.

I see you found a new possible cause, thank you for looking into this!

JonWatson avatar May 20 '24 21:05 JonWatson

The commits above should this the issue I believe (will be released with 1.4.0-alpha02). If you are seeing it again after this release, please let us know.

tonihei avatar May 21 '24 08:05 tonihei