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 edge-case in main audio-only with track descriptions #2943

Merged

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Aug 2, 2020

This PR will...

  • Do not flush audio on audio track switch when both tracks are main variant streams
  • Clean up test streams and test abr properties
  • Add a "Next video" button in "Playback" to quickly cycle through streams in the drop-down
  • Update the drop-down on page load to match the permalink video when a match is found
  • Clean up some console logging around segment loading

Why is this Pull Request needed?

When playing a stream with variants whose audio is described in MEDIA tracks (with no alt audio), the audio-stream-controller will trigger track change events on level switch. This has the unintended side-effect of making the stream-controller flush all audio in onAudioTrackSwitching. Unfortunately this flush command may prevent the init segment for the new audio variant from being appended. In the case where the audio sample rate changes between variants this can be very bad, since buffer appends of the new variant will be treated as if they used the old sample rate and audio will not be appended at the correct location with the expected duration.

Are there any points in the code the reviewer needs to double check?

Are there any scenarios where we would still need to flush the audio buffer when switching from main to main audio on track switch?

Resolves issues:

#2837

Checklist

  • changes have been done against master branch, and PR does not conflict
  • new unit / functional tests have been added (whenever applicable)
  • API or design changes are documented in API.md

@robwalch robwalch added this to the 0.15.0 milestone Aug 2, 2020
@robwalch robwalch requested a review from itsjamie August 2, 2020 02:25
@@ -169,6 +169,7 @@ <h3>
</p>
<p>
<span>
<button type="button" class="btn btn-xs btn-default" onclick="$('#streamSelect')[0].selectedIndex++;$('#streamSelect').change()">Next video</button>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a big fan of inline html event handlers, but this is just personal opinion, and I see we do it all over.
Maybe add to the demo js file as util method?
Easier for linters and other tools to pick up on things.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just something quick and dirty for now to speed up running manual tests on all test streams in the demo page. The button should be next to the select menu, no inline html js, ditch jQuery... all the nice to haves.

'abr': false
url: 'https://test-streams.mux.dev/bbbAES/playlists/sample_aes/index.m3u8',
description: 'SAMPLE-AES encrypted',
live: false,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Delete live?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's the default. This streams no up anymore though, so this comment is more a reminder that we are missing a Sample-AES test stream.

'blacklist_ua': ['safari', 'internet explorer']
url: 'https://storage.googleapis.com/shaka-demo-assets/angel-one-hls/hls.m3u8',
description: 'HLS fMP4 Angel-One multiple audio-tracks',
abr: true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

ABR was false before, did you mean to put true?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this stream has multiple variants. It was probably set to false to skip tests. If the smooth switch test fails on this stream, I want to know.

Copy link
Collaborator

@OrenMe OrenMe left a comment

Choose a reason for hiding this comment

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

LGTM, I added some (nitpicking) comments.
In general I think we should separate between general maintenance PRs for better maintainability.

@OrenMe
Copy link
Collaborator

OrenMe commented Aug 2, 2020

Ok, I see that one of the functional tests is failing. Is this due to the change or it is a flaky one?

@robwalch
Copy link
Collaborator Author

robwalch commented Aug 2, 2020

@OrenMe. I'm re-running that job. I couldn't reproduce the issue locally. That is probably one of the streams that didn't have abr: true on it before so this test did not run on it prior to these changes. On the plus side continuous-integration/travis-ci/push passed with Firefox at 100% for the first time.

@robwalch robwalch merged commit e530158 into master Aug 4, 2020
@robwalch robwalch deleted the bugfix/do-not-flush-main-to-main-audio-only-track-switch branch August 4, 2020 04:01
@robwalch robwalch modified the milestones: 0.15.0, 0.14.8 Aug 4, 2020
@robwalch robwalch modified the milestones: 0.15.0, 0.14.8 Aug 7, 2020
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.

None yet

2 participants