androidx / androidx/media

CRASH occurs when playing from USB and custom buffer duration

Open
#2,346 7 comments 0 reactions 1 assignee View on GitHub

@tonihei is already working on this.

Since Apr 17, 2025.

bug needs triage
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

Version

Media3 main branch

More version details

Unmount the USB device while playing music from the USB, and the application crashes

steps:
1.mounted usb
2.play media from usb
3.unmounted usb
4.app crash

In order to increase chance to reproduce the issue, initialize the player with the following buffer duration:
ExoPlayer.Builder(context).apply {
val loadControl: LoadControl = DefaultLoadControl
.Builder()
.setBufferDurationsMs(
1000,
3000,
500,
1000,
)
.build()
setLoadControl(loadControl)
}.build()

Devices that reproduce the issue

tablet using Android 12

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes, but using the custom load control (see example above) and file from usb

Reproduction steps

steps:
1.initialize the player with the following buffer duration:
.setBufferDurationsMs(
1000,
3000,
500,
1000,
)
2.mounted usb
3.play media from usb
4.unmounted usb
5.app crash

Expected result

The media freezes or player throws an exception

Actual result

App just crashes without any exception

Media

https://thetestdata.com/assets/video/mp4/1080/200MB_1080P_THETESTDATA.COM_mp4.mp4

Bug Report
  • You will email the zip file produced by adb bugreport to android-media-github@google.com after filing this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.