Repository navigation
HLS: every exposed track Format has a null id in 1.11.0 (regression from 1.9.x) #3402
Description
Title: HLS: every exposed track Format has a null id in 1.11.0 (regression from 1.9.x)
Version
Media3 1.11.0
More version details
Regression relative to Media3 1.9.0 (same app, same content, same device).
Devices that reproduce the issue
- NVIDIA SHIELD Android TV (2019, mdarcy) running Android 11 (API 30)
Devices that do not reproduce the issue
- The same device with the same app built against Media3 1.9.0 exposes the ids as expected.
Reproducible in the demo app?
Not tested
Reproduction steps
- Play an HLS multivariant playlist that carries
EXT-X-STREAM-INFvariants andEXT-X-MEDIAaudio renditions (the one used here has 13 variants and four audio rendition groups,aud-aac,aud-ec3,aud-ac3,aud-aac-lo, all namedAudio). DefaultDefaultTrackSelector, defaultHlsMediaSource.Factory(chunkless preparation left enabled). - In
Player.Listener.onTracksChanged(or any time after prepare), iterateplayer.getCurrentTracks().getGroups()and readgroup.getTrackFormat(i).idfor every track of every group.
Expected result
Ids are present, as on 1.9.x:
- variants: the variant index (
"0","1", ...), matchingHlsManifest.multivariantPlaylist.variants[i].format.id - audio renditions:
"<GROUP-ID>:<NAME>", e.g."aud-aac:Audio", matchingmultivariantPlaylist.audios[i].format.id - subtitle renditions: likewise
Actual result
Format.id is null (and Format.metadata is null) for every exposed HLS track: video, audio and text. Playback itself is fine. Sources played through ProgressiveMediaSource (a Matroska file in the same app) are unaffected, their formats keep their ids.
Cause, as far as I can tell from the 1.11.0 source:
HlsRedundantGroup.GroupKeybuilds the format it stores withformat.buildUpon().setId(null).setMetadata(null).build()so that "only fields affecting identity are part of the key".HlsMediaPeriodnow prepares the track groups from those key formats rather than the original playlist formats:selectedRedundantGroupFormats[outIndex] = variantRedundantGroup.groupKey.formatinbuildAndPrepareMainSampleStreamWrapper,scratchRedundantGroupFormats.add(audioRedundantGroup.groupKey.format)inbuildAndPrepareAudioSampleStreamWrappers, and the same for subtitles.- With chunkless preparation those formats are exposed as-is, and
HlsSampleStreamWrapper.deriveFormatcopiesplaylistFormat.id(now null) onto formats derived from sample data, so the id never comes back.
Impact: anything that identifies or selects tracks by Format.id (documented as the identifier of a track) can no longer do so for HLS, and exposed formats can no longer be joined back to HlsManifest.multivariantPlaylist entries by id. TrackSelectionOverride by group and index still works, which is why playback and the default selection are unaffected.
A possible fix: keep using the normalized format as the key of the redundant group, but expose the original playlist Format (with its id, or the stable id) in the prepared track groups.
Media
Reproduced with a private multivariant playlist; it should reproduce with any playlist that has EXT-X-MEDIA audio renditions, since the id is cleared unconditionally in GroupKey. Happy to email the playlist to android-media-github@google.com after filing if needed.
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Activity
rohitjoins commentedon Sep 10, 2026
Hi @Apezdr,
Thanks for the detailed report! We're preparing a fix for this.
Quick question to make sure we cover your use case: in
1.11.0, identical streams from redundant pathways/CDNs are grouped together so they don't appear as duplicate tracks in the player. Our planned fix restoresFormat.idandFormat.metadatausing the first/representative stream of each redundant group (e.g. youraud-aac:Audioexample works as expected).Could you share a bit more on how your app uses
Format.idandmetadata? Specifically, is having the representative format's ID/metadata per track sufficient for your track identification/UI, or does your app need to distinguish between individual redundant streams that share the same encoding/rendition?cc: @tianyif
Preserve Format.id and Format.metadata in HlsRedundantGroup.GroupKey
rohitjoins commentedon Sep 20, 2026
Thank you for reporting the issue, we have added a fix.