SimpleCache generate playback errors for some files.
@marcbaechinger is already working on this.
Since Mar 6, 2025.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 pre-release (alpha, beta or RC not in this list)
More version details
1.6.0 RC1
Devices that reproduce the issue
All
Devices that do not reproduce the issue
N/A
Reproducible in the demo app?
Not tested
Reproduction steps
I'm still trying to build a simple repro but I'll need help to understand the fundamental difference when using SimpleCache or not leading to the bug.
The app is transcoding some WMA files to FMP4/ALAC on the local device file and exposed via a webserver.
This works perfectly fine and the media are played without an issue. Previously when wrapping those files with a CacheDataSource they worked too.
Now users reports errors that can occurs during the playback at different positions.
2025-03-03 15:17:47.693 Error ExoPlayer playerFailed [eventTime=626.37, mediaPos=137.28, window=0, period=0, errorCode=ERROR_CODE_IO_UNSPECIFIED
v4.n: Source error
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:820)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:796)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.os.HandlerThread.run(HandlerThread.java:85)
Caused by: java.io.EOFException
at androidx.media3.exoplayer.source.SampleDataQueue.sampleData(SampleDataQueue.java:186)
at androidx.media3.exoplayer.source.SampleQueue.sampleData(SampleQueue.java:602)
at androidx.media3.extractor.TrackOutput.sampleData(TrackOutput.java:168)
at androidx.media3.extractor.mp4.FragmentedMp4Extractor.readSample(FragmentedMp4Extractor.java:1705)
at androidx.media3.extractor.mp4.FragmentedMp4Extractor.read(FragmentedMp4Extractor.java:529)
at androidx.media3.exoplayer.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:147)
at androidx.media3.exoplayer.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1146)
at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:453)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
]
Since the file is already fully transcoded, the error is not triggered by trying to read before the file is finished to transcode, it's something that is handled differently due to the wrapping.
I do not get any other error from the cache or anything, so no idea where to look.
Expected result
The file should play as without using the cache.
Actual result
File does not play and stop randomly in the middle see above.
Media
Needing some more details first to be able to build a repro as it's maybe due to the webserver headers or something.
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
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.