-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
IndexOutOfBoundsException: SimpleExoPlayer.getDuration() #3362
Comments
Can you give us some more details about the media sources you use and the point in time when this exception occurs (e.g. does it happen after a seek, or in which method do you call player.getDuration())? |
Also, how do you call |
I didn't experience this crash on my device, so I don't know what really happen before crash. I use This error didn't happen on previous |
It happens when I call |
Thanks for the additional info. We have some ideas what might be going wrong here and are currently looking into this. We'll let you know as soon as we published a fix. |
This makes it a bit more obvious what's going on during preparation. In particular, it makes it clear that MSG_SOURCE_INFO_REFRESHED arrives before MSG_TRACKS_CHANGED. Issue: #3362 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=173392080
1. Move Timeline/Manifest into PlaybackInfo 2. Don't update externally visible Timeline/Manifest during preparation 3. Ignore MSG_POSITION_DISCONTINUITY during preparation 4. Correctly set masking variables at start of preparation, and use them Once this change goes in, PlaybackInfo will contain timeline, manifest and position, which should always be self-consistent with one another. The next step would then be to move a bunch of logic in ExoPlayerImpl that derives state from timeline and position into PlaybackInfo, and split that into its own top level class that can be easily tested to make sure it never IndexOutOfBounds. I think we could also replace the masking variables and instead just assign a new PlaybackInfo to the playbackInfo variable whenever we're doing something that requires masking. This should be possible because we no longer update playbackInfo whenever we have pending acks. It would require allowing PlaybackInfo to mask the window position internally when the timeline is empty, but I think this is ok, and again is something we could test pretty easily. Issue: #3362 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=173909791
Should be fixed in |
Issue description, Reproduction steps
I have no idea why and how does it happen, just receive some crash logs from my crash reporting service (affected at lest 30 users, 20 different kind of devices).
I post here to find if someone have same issue or has solution for it.
Link to test content
N/A
Version of ExoPlayer being used
r2.5.3
Device(s) and version(s) of Android being used
Variety device and version.
A full bug report captured from the device
Crash log:
The text was updated successfully, but these errors were encountered: