Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfBoundsException during playback #6776

Closed
kkovach opened this issue Dec 17, 2019 · 1 comment
Closed

IndexOutOfBoundsException during playback #6776

kkovach opened this issue Dec 17, 2019 · 1 comment
Assignees
Labels

Comments

@kkovach
Copy link

kkovach commented Dec 17, 2019

[REQUIRED] Issue description

I get the following exception and crash while playing audio.

Fatal Exception: java.lang.IndexOutOfBoundsException
       at com.google.android.exoplayer2.util.Assertions.checkIndex(Assertions.java:68)
       at com.google.android.exoplayer2.source.SinglePeriodTimeline.getWindow(SinglePeriodTimeline.java:175)
       at com.google.android.exoplayer2.source.MaskingMediaSource$MaskingTimeline.getWindow(MaskingMediaSource.java:266)
       at com.google.android.exoplayer2.source.AbstractConcatenatedTimeline.getWindow(AbstractConcatenatedTimeline.java:199)
       at com.google.android.exoplayer2.Timeline.getWindow(Timeline.java:668)
       at com.google.android.exoplayer2.analytics.AnalyticsCollector.generateEventTime(AnalyticsCollector.java:612)
       at com.google.android.exoplayer2.analytics.AnalyticsCollector.generateEventTime(AnalyticsCollector.java:636)
       at com.google.android.exoplayer2.analytics.AnalyticsCollector.generateMediaPeriodEventTime(AnalyticsCollector.java:662)
       at com.google.android.exoplayer2.analytics.AnalyticsCollector.onMediaPeriodCreated(AnalyticsCollector.java:318)
       at com.google.android.exoplayer2.source.MediaSourceEventListener$EventDispatcher.lambda$mediaPeriodCreated$0$MediaSourceEventListener$EventDispatcher(MediaSourceEventListener.java:371)
       at com.google.android.exoplayer2.source.-$$Lambda$MediaSourceEventListener$EventDispatcher$N-EOPAK5UK0--YMNjezq7UM3UNI.run(:6)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:214)
       at android.os.HandlerThread.run(HandlerThread.java:67)

[REQUIRED] Reproduction steps

I cannot reliably reproduce this issue, but I suspect that it might be caused by multiple calls to ConcatenatingMediaSource.addMediaSouce() Rough application flow is as follows...

  • Add single MediaSource to a ConcatenatingMediaSource
  • Prepare player with that ConcatenatingMediaSource
  • Once the timeline has changed set speed and playWhenReady to true
  • Add multiple (variable number of) additional MediaSources to the ConcatenatingMediaSource

[REQUIRED] Link to test content

Do not have any of this right now.

[REQUIRED] A full bug report captured from the device

Will do if necessary.

[REQUIRED] Version of ExoPlayer being used

2.11.0

[REQUIRED] Device(s) and version(s) of Android being used

Pixel 3 - Android 10

@tonihei
Copy link
Collaborator

tonihei commented Dec 20, 2019

This issue was already fixed by a recent change.

This change may still be some way away from being part of a release. I added a smaller fix to 2.11.1 too

@tonihei tonihei closed this as completed Dec 20, 2019
ojw28 added a commit that referenced this issue Dec 20, 2019
PiperOrigin-RevId: 286586865
ojw28 added a commit that referenced this issue Dec 20, 2019
PiperOrigin-RevId: 286586865
@google google locked and limited conversation to collaborators Feb 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants