-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Getting IndexOutOfBoundsException crash in SinglePeriodTimeline #4634
Comments
Please can you de-obfuscate the stack trace. |
Please find below de-obfuscated stack trace.
|
I am also facing the exactly same crash in my app in production on exoplayer version 2.8.2. This crash happens while adding or removing media in ConcatenatingMediaSource using addMediaSource or removeMediaSource. This crash is affecting a large portion of our users, is there a fix or workaround for this ? |
Unfortunately, I can't reproduce the issue with the code above. Can you try to provide minimal reproduction steps in our demo app? Please also verify that you access ExoPlayer from the main thread only as this issue may have been caused by parallel access. In any case, we will change something internally which will make the problem obsolete as the call to this method won't happen anymore. |
Thanks for the quick reply. We are for sure accessing Exoplayer from main thread. Unfortunately i can't provide any reproduction steps as this crash comes at scale(when we release app). |
Most likely 2.9.0, but we don't have a fixed date for that yet. |
The current structure tries to associate events to media periods and windows based on the reported values and the current timeline. However the reported EventTime may not always be consistent in case the timeline doesn't contain windows or media periods yet or not anymore. The recent changes to MediaPeriodId allow to use it as a unique identifer for media periods independent of the timeline. This enables more accurate tracking of the media period queue and prevents reporting events with inconsistent data. Issue:#4492 Issue:#4634 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=210713120
@tonihei - Can this issue be closed? |
Yes, it's fixed (or rather not longer applicable) by above mentioned change. |
Issue description
Production users of my app are getting following crash sometimes.
Following is the crash logs -:
Reproduction steps
I am using Exoplayer DynamicConcatenatingMediaSource for prefetching next song in song queue.
I am keeping only two sources at a time in DynamicConcatenatingMediaSource.As soon as I get the third source for adding in DynamicConcatenatingMediaSource, I remove the previous index source from DynamicConcatenatingMediaSource.
stacktrace.txt
Following is the code snippet I'm using -:
public void onPositionDiscontinuity(int reason) { int newIndex = exoPlayer.getCurrentWindowIndex(); if (newIndex != currentIndex) { // The index has changed; update the UI to show info for source at // newIndex currentIndex = newIndex; removeMediaSource(exoPlayer.getPreviousWindowIndex()); currentIndex = exoPlayer.getCurrentWindowIndex(); } }
`
private void removeMediaSource(int index) {
if (index >= 0 && index < dynamicConcatenatingMediaSource.getSize()) {
dynamicConcatenatingMediaSource.removeMediaSource(index, new Runnable() {
Version of ExoPlayer being used
Exoplayer version - 2.8.2
Device(s) and version(s) of Android being used
Device-Redmi Note 5 Android-7.1.2
Device-Moto G(4) Plus Android-6.0
The text was updated successfully, but these errors were encountered: