Skip to content

stream: fix 8-channel AAC always-available tracks refusing 7.1 publishers - #6414

Merged
aler9 merged 1 commit into
bluenviron:mainfrom
spicysharkco:fix/always-available-aac-8ch
Oct 25, 2026
Merged

aler9 merged 1 commit into
bluenviron:mainfrom
spicysharkco:fix/always-available-aac-8ch

Conversation

@spicysharkco

Copy link
Copy Markdown
Contributor

An alwaysAvailableTracks entry {codec: MPEG4Audio, sampleRate: 48000, channelCount: 8} refuses a 7.1 AAC publisher: MPEG-4 audio configuration does not match, is type=2, sampleRate=48000, channelCount=7, but stream expects type=2, sampleRate=48000, channelCount=8.

mediasFromAlwaysAvailableTracks sets the track's ChannelConfig to the channel count (stream.go#L173-L188). Configuration 8 is reserved, and a 7.1 publisher's configuration is 7, so the two differ. The MoQ code had the same mapping and was fixed in #6406.

Use configuration 7 for 8 channels, so that publisher is accepted. Other channel counts keep their result. An MPEG-TS recording of the offline 8-channel track gets ADTS channel configuration 7, not 0.

TestStreamAlwaysAvailableErrors gets a row with an 8-channel track and a 7.1 publisher at another sample rate. The track side of its error now ends channelCount=7, not channelCount=8. It fails three times without the fix and passes three times with it.

go test -count=3 -p 1 -timeout 120s -v -run '^TestStreamAlwaysAvailableErrors$' ./internal/stream
go test -race -count=1 -p 1 -timeout 600s ./internal/stream

…hers

With an always-available MPEG4Audio track of channelCount 8, a 7.1 AAC
publisher is refused with "MPEG-4 audio configuration does not match".
The track uses channel configuration 8, which is reserved, while the
publisher's configuration is 7.

Channel configuration 7 stands for 8 channels. Use configuration 7 for
an 8-channel track. Other channel counts are unchanged.
@codecov

codecov Bot commented Oct 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.31%. Comparing base (437cc96) to head (b0d37ee).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6414   +/-   ##
=======================================
  Coverage   71.31%   71.31%           
=======================================
  Files         289      289           
  Lines       21968    21971    +3     
=======================================
+ Hits        15666    15669    +3     
  Misses       6302     6302           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aler9

aler9 commented Oct 25, 2026

Copy link
Copy Markdown
Member

merged, thanks

@aler9
aler9 merged commit b5df462 into bluenviron:main Oct 25, 2026
12 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

This issue is mentioned in release v1.21.3 🚀
Check out the entire changelog by clicking here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants