Skip to content

DownloadHelper.getDownloadRequest() crashes with IndexOutOfBoundsException in HlsMediaPeriod.getStreamKeys() for HLS streams with a demuxed audio rendition and no subtitles #3333

Closed

Description

@tomoya0x00

Version

Media3 1.10.1

More version details

No response

Devices that reproduce the issue

  • Pixel 6 running Android 17 (build CP31.260618.005)

Devices that do not reproduce the issue

None found.

Reproducible in the demo app?

Yes

Reproduction steps

The only change needed to the demo app is adding one entry to its media list.

  1. Check out the 1.10.1 tag of this repository.
  2. Add the following sample to the HLS group in demos/main/src/main/assets/media.exolist.json:
    {
      "name": "Repro: demuxed audio, no subtitles",
      "uri": "https://storage.googleapis.com/shaka-demo-assets/bbb-dark-truths-hls/hls.m3u8"
    }
  3. ./gradlew :demo:assembleNoDecoderExtensionsDebug and install the APK.
  4. In the demo app, expand HLS and tap the download icon next to the new sample.
  5. In the track-selection dialog, leave the defaults (VIDEO = 自動 / Auto, AUDIO = default) and press OK.

The app crashes immediately, before any segment is downloaded.

Expected result

DownloadHelper.getDownloadRequest() returns a DownloadRequest whose streamKeys cover the selected video
variant and the selected audio rendition, and the download starts.

Actual result

The app crashes:

FATAL EXCEPTION: main
Process: androidx.media3.demo.main, PID: 8815
java.lang.IndexOutOfBoundsException: index (0) must be less than size (0)
	at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1372)
	at com.google.common.base.Preconditions.checkElementIndex(Preconditions.java:1354)
	at com.google.common.collect.RegularImmutableList.get(RegularImmutableList.java:84)
	at androidx.media3.exoplayer.hls.HlsMediaPeriod.getStreamKeys(HlsMediaPeriod.java:289)
	at androidx.media3.exoplayer.offline.DownloadHelper.getDownloadRequestBuilder(DownloadHelper.java:939)
	at androidx.media3.exoplayer.offline.DownloadHelper.getDownloadRequest(DownloadHelper.java:891)
	at androidx.media3.exoplayer.offline.DownloadHelper.getDownloadRequest(DownloadHelper.java:860)
	at androidx.media3.demo.main.DownloadTracker$StartDownloadDialogHelper.buildDownloadRequest(DownloadTracker.java:368)
	at androidx.media3.demo.main.DownloadTracker$StartDownloadDialogHelper.onTracksSelected(DownloadTracker.java:250)
	at androidx.media3.demo.main.TrackSelectionDialog.lambda$createForTracksAndParameters$0(TrackSelectionDialog.java:161)
	...

Media

https://storage.googleapis.com/shaka-demo-assets/bbb-dark-truths-hls/hls.m3u8

Bug Report

Activity

  1. self-assigned this
    on Jul 13, 2026
  2. tianyif commented on Jul 14, 2026

    @tianyif
    Contributor

    Hi @tomoya0x00, thanks for reporting! We are making a fix for this.

  3. N0bitaN0bi commented on Jul 17, 2026

    @N0bitaN0bi

    VDH not working today on the tube and on other sites. Trieed on new clean Firefox profile without any success. It used to work until yesterday or the day before. IFF 152.0.6 (64 bit) on Ubuntu 24.04LTS italy

  4. locked and limited conversation to collaborators on Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions