Playback does not start for a specific MPEG/TS stream
@rohitjoins is already working on this.
Since Dec 13, 2024.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
I'm running the androidx-media3 demo app (from 1.5.0 release) on an Android device and I've encountered an issue with a specific MPEG/TS stream whereby the playback doesn't start. In the logs, I see a repetition of
12-12 20:54:38.518 5656 5690 W DefaultLoadControl: Target buffer size reached with less than 500ms of buffered media data.
and the playback eventually fails with
12-12 20:54:38.532 5656 5690 E ExoPlayerImplInternal: Playback error
12-12 20:54:38.532 5656 5690 E ExoPlayerImplInternal: androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error
12-12 20:54:38.532 5656 5690 E ExoPlayerImplInternal: at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:721)
12-12 20:54:38.532 5656 5690 E ExoPlayerImplInternal: at android.os.Handler.dispatchMessage(Handler.java:102)
12-12 20:54:38.532 5656 5690 E ExoPlayerImplInternal: at android.os.Looper.loopOnce(Looper.java:201)
12-12 20:54:38.532 5656 5690 E ExoPlayerImplInternal: at android.os.Looper.loop(Looper.java:288)
12-12 20:54:38.532 5656 5690 E ExoPlayerImplInternal: at android.os.HandlerThread.run(HandlerThread.java:67)
12-12 20:54:38.532 5656 5690 E ExoPlayerImplInternal: Caused by: java.lang.IllegalStateException: Playback stuck buffering and not loading
12-12 20:54:38.532 5656 5690 E ExoPlayerImplInternal: at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1224)
12-12 20:54:38.532 5656 5690 E ExoPlayerImplInternal: at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:562)
12-12 20:54:38.532 5656 5690 E ExoPlayerImplInternal: ... 4 more
A stream sample will be shared via email. This is normally a live TV stream broadcasted with UDP/multicast. For testing purpose, I'm streaming the .ts sample via HTTPS and play it with:
adb shell am start -a androidx.media3.demo.main.action.VIEW -d https://...
I understand that the stream is not clean (quite the opposite), but I'm looking for options in order to handle the case more gracefully than playback failure (and the TV/hardware provider claims everything is ok as VLC can play the channel fine...). I've already tried to tweak various buffering-related constants in the code to work around the issue, but have been unsuccessful so far. I'm not sure the root cause is a buffer-limit issue.
Any assistance or pointers would be greatly appreciated.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.