Crash when seeking within bounds of clipped media
- Dominant language
- Java
- Stars
- 21.9k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
### ExoPlayer Version
2.18.2
### Devices that reproduce the issue
- OnePlus 8T
- Emulator Android 11.0 arm64-v8a
### Devices that do not reproduce the issue
None so far
### Reproducible in the demo app?
Not tested
### Reproduction steps
Given an MP3 file as media:
Let `x` be an integer offset less than the duration of the media that playback should start from.
Let `y` be an integer position less than the duration of the media that the user requests to seek to, where `x` + `y` > duration of media.
1. Set audio clipping of media to `x`.
2. Seek to `y`.
In my case (in the linked media),`x` was 714827 ms, `y` was 1729561 ms, and duration was 1860000.
### Expected result
Media continues playback from `y`.
### Actual result
ERROR_CODE_FAILED_RUNTIME_CHECK (1004).
Stack trace: com.google.android.exoplayer2.ExoPlaybackException: Unexpected runtime error
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:621)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:223)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: java.lang.IllegalStateException: Playback stuck buffering and not loading
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1075)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:495)
... 3 more
And occasionally an index out of bounds exception
### Media
https://torahcdn.net/tdn/1036481.mp3
### Bug Report
- [X] You will email the zip file produced by `adb bugreport` to dev.exoplayer@gmail.com after filing this issue.
Contributor guide
Assessment
This issue has not been assessed yet.