xbmc / xbmc/inputstream.adaptive
[Bug] [HLS] IA chooses the wrong audio stream - Ignoring the AUDIO / group-id
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 531
- Forks
- 270
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 3
Description
Describe the problem
With the below, IA will try to use the "233" audio even though the single video stream has AUDIO="234"
With ffmpeg will use and only show the single "234" audio stream.
It might only happen when there is a single video stream.
As if I pass the entire manifest through - IA has the 2nd audio stream listed first and it uses that.
However, it then keeps in-correctly using that for the lowest quality video stream that should use "233"
Possible fix
Remove / ignore audio streams without a matching group-id to the currently playing video stream
Steps to reproduce
- Create a HLS manifest with 2x audio streams with GROUP-ID="1" and GROUP-ID="2" in that order
Have DEFAULT NO and AUTOSELECT YES on both - Add single video stream with AUDIO="2"
- Play the HLS
- Observe IA will just select the first audio stream - when it should use the 2nd
- ffmpeg doesn't even show the first audio stream
Debug log
..
Stream manifest file(s)
#EXTM3U
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-MEDIA:URI="https://example.com/audio/playlist/233.m3u8",TYPE="AUDIO",GROUP-ID="233",NAME="Default",DEFAULT="NO",AUTOSELECT="YES"
#EXT-X-MEDIA:URI="https://example.com/audio/playlist/234.m3u8",TYPE="AUDIO",GROUP-ID="234",NAME="Default",DEFAULT="NO",AUTOSELECT="YES"
#EXT-X-STREAM-INF:BANDWIDTH=7171631,CODECS="avc1.64002A,mp4a.40.2",RESOLUTION=1920x1080,FRAME-RATE=60,VIDEO-RANGE=SDR,AUDIO="234",CLOSED-CAPTIONS=NONE
https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1787380794/playlist/video.m3u8
Additional info
No response
Operating system(s)
Windows
Operating system version(s)
11
InputStream Adaptive version(s)
22.3.20
Kodi version(s)
22
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start by reproducing the issue with the supplied HLS manifest, then trace the HLS audio and video stream selection logic. Check how the video stream's AUDIO group-id is matched against available audio streams. Done means playback selects only the audio stream whose group-id matches the selected video stream, including the single-video-stream case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100