Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix missing audio streams #5869

Merged
merged 2 commits into from
Nov 13, 2023
Merged

Conversation

avelad
Copy link
Member

@avelad avelad commented Nov 8, 2023

Fixes #5858

@avelad avelad added type: bug Something isn't working correctly priority: P1 Big impact or workaround impractical; resolve before feature release labels Nov 8, 2023
@avelad avelad added this to the v4.6 milestone Nov 8, 2023
@shaka-bot
Copy link
Collaborator

Incremental code coverage: 100.00%

const getAudioId = (stream) => {
const validAudioIds = [];
const validAudioStreamsMap = new Map();
const getAudioGroupId = (stream) => {
return stream.language + (stream.channelsCount || 0) +
(stream.audioSamplingRate || 0) + stream.roles.join(',') +
stream.label + stream.groupId + stream.fastSwitching;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kind of weird how this function is now called getAudioGroupId, and yet one of the many factors that goes into it is stream.groupId.
I'm having a hard time coming up with a better name, admittedly. getAudioDuplicateId or something?

Copy link
Member Author

@avelad avelad Nov 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to getAudioId

const includedStream = audioStreamsMap.get(id);
if (includedStream.bandwidth > stream.bandwidth) {
audioStreamsMap.set(id, stream);
const previousStream = validAudioStreams[validAudioStreams.length - 1];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'm trying to understand the exact logic of the change.

Our previous behavior was to present the lowest-bandwidth stream for each groupId.

Now, within each groupId, we have at most one stream per bandwidth. And we also filter out every stream that does not share a codec with the lowest-bandwidth stream in that groupId (which we did not have to do since previously we only had one stream per groupId anyway, so no need to worry about adapting between codecs).

Is that correct?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's right

@avelad avelad requested a review from theodab November 13, 2023 07:47
@avelad avelad merged commit d6aab6b into shaka-project:main Nov 13, 2023
15 of 16 checks passed
@avelad avelad deleted the audio-filtering branch November 13, 2023 08:25
Robloche pushed a commit to Robloche/shaka-player that referenced this pull request Nov 30, 2023
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Jan 12, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Jan 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DASH: Missing Variant Tracks for Audio Representations in a Single AdaptationSet
3 participants