-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 multi-period DASH with descriptive audio #4629
Conversation
…mbination with description audio tracks
// If the language doesn't match, but the candidate is the "primary" | ||
// language, then that should be preferred as a fallback. | ||
if (!best.primary && candidate.primary) { | ||
return true; | ||
} | ||
if (best.primary && !candidate.primary) { | ||
return false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joeyparrish Removing this completely caused a number of issues, but moving it below the role
check solves the issue.
@@ -1141,14 +1149,163 @@ describe('PeriodCombiner', () => { | |||
expect(audio2.originalId).toBe('stream2,stream4'); | |||
}); | |||
|
|||
it('Matches streams with roles in common', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test simulates the stream that originally manifested the issue. It is a multi-period steam where all periods have the same number of video and audio adaptation sets, and the audio adaptations both have roles, one main
and one description
.
expect(audio4.originalId).toBe('stream2,stream2'); | ||
}); | ||
|
||
it('Matches streams with mismatched roles', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test simulates a similar stream to the one above, but this time with periods representing pre-roll and mid-roll ads that only have main
audio tracks.
Incremental code coverage: 100.00% |
test/util/periods_unit.js
Outdated
makeAVVariant(720, 'en'), | ||
makeAVVariant(1080, 'en'), | ||
makeAVVariant(720, 'en'), | ||
makeAVVariant(1080, 'en'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add an optional roles argument to makeAVVariant? I think this part of the test would be clearer if we could see the expected roles here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This looks great overall. I'm excited to include it in the bugfix releases I've been preparing. |
Perform the `primary` check after `role` check to improve period flattening on streams with both `main` and `description` audio tracks. Resolves #4500 Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
Perform the `primary` check after `role` check to improve period flattening on streams with both `main` and `description` audio tracks. Resolves #4500 Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
Perform the `primary` check after `role` check to improve period flattening on streams with both `main` and `description` audio tracks. Resolves #4500 Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
Perform the `primary` check after `role` check to improve period flattening on streams with both `main` and `description` audio tracks. Resolves #4500 Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
Perform the `primary` check after `role` check to improve period flattening on streams with both `main` and `description` audio tracks. Resolves #4500 Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
Perform the `primary` check after `role` check to improve period flattening on streams with both `main` and `description` audio tracks. Resolves #4500 Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
Perform the
primary
check afterrole
check to improve period flattening on streams with bothmain
anddescription
audio tracks.Resolves #4500