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 A/V sync in unaligned HLS VOD streams #4528

Merged
merged 11 commits into from
Oct 3, 2022

Conversation

JulianDomingo
Copy link
Collaborator

@JulianDomingo JulianDomingo commented Sep 29, 2022

Fix is based on suggestions from @joeyparrish in #4308 (comment).

During automatic adaptations, Shaka will now reset the timestamp offset to ensure the newly active track is properly aligned in the presentation.

Verified by disabling ABR and manually triggering variant switches (shaka.Player.selectVariantTrack()) between seemingly problematic combinations (e.g., 400k bps => 6000k bps stream). Behavior was compared against production.

Since adaptation events are only triggered by ABR logic (and ABR was disabled for manual testing), selectVariantTrack() logic was temporarily changed from:

this.switchVariant_(variant, /* fromAdaptation= */ false, clearBuffer, safeMargin);
=>
this.switchVariant_(variant, /* fromAdaptation= */ true, clearBuffer, safeMargin);

to ensure the fixes proposed in this PR were taken into effect and being used during manual testing. Tested content is from the reported bug, located here: #4308 (comment)

Closes #4308

@avelad avelad added type: bug Something isn't working correctly component: HLS The issue involves Apple's HLS manifest format labels Sep 29, 2022
@avelad avelad added this to the v4.3 milestone Sep 29, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Sep 29, 2022

Incremental code coverage: 100.00%

@avelad avelad added the priority: P1 Big impact or workaround impractical; resolve before feature release label Sep 29, 2022
@JulianDomingo JulianDomingo marked this pull request as ready for review September 30, 2022 19:07
@avelad avelad linked an issue Sep 30, 2022 that may be closed by this pull request
@avelad avelad self-requested a review October 3, 2022 16:35
Copy link
Collaborator

@avelad avelad left a comment

Choose a reason for hiding this comment

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

Manually tried the branch and there seems to be no problem, also tried the stream of #4308 and there is no problem.

@joeyparrish joeyparrish changed the title fix: reset SourceBuffer#timestampOffset() on automatic adaptations fix: Fix support for unaligned HLS VOD streams Oct 3, 2022
@joeyparrish joeyparrish changed the title fix: Fix support for unaligned HLS VOD streams fix: Fix A/V sync in unaligned HLS VOD streams Oct 3, 2022
@joeyparrish joeyparrish merged commit 8c198df into shaka-project:main Oct 3, 2022
JulianDomingo added a commit that referenced this pull request Oct 6, 2022
Fix is based on suggestions from @joeyparrish in
#4308 (comment).

During automatic adaptations, Shaka will now reset the timestamp offset
to ensure the newly active track is properly aligned in the
presentation.

Verified by disabling ABR and manually triggering variant switches
(`shaka.Player.selectVariantTrack()`) between seemingly problematic
combinations (e.g., `400k` bps => `6000k` bps stream). Behavior was
compared against production.

Since `adaptation` events are only triggered by ABR logic (and ABR was
disabled for manual testing), `selectVariantTrack()` logic was
temporarily changed from:

`this.switchVariant_(variant, /* fromAdaptation= */ false, clearBuffer,
safeMargin);`
=>
`this.switchVariant_(variant, /* fromAdaptation= */ true, clearBuffer,
safeMargin);`

to ensure the fixes proposed in this PR were taken into effect and being
used during manual testing. Tested content is from the reported bug,
located here:
#4308 (comment)

Closes #4308
JulianDomingo added a commit that referenced this pull request Oct 6, 2022
Fix is based on suggestions from @joeyparrish in
#4308 (comment).

During automatic adaptations, Shaka will now reset the timestamp offset
to ensure the newly active track is properly aligned in the
presentation.

Verified by disabling ABR and manually triggering variant switches
(`shaka.Player.selectVariantTrack()`) between seemingly problematic
combinations (e.g., `400k` bps => `6000k` bps stream). Behavior was
compared against production.

Since `adaptation` events are only triggered by ABR logic (and ABR was
disabled for manual testing), `selectVariantTrack()` logic was
temporarily changed from:

`this.switchVariant_(variant, /* fromAdaptation= */ false, clearBuffer,
safeMargin);`
=>
`this.switchVariant_(variant, /* fromAdaptation= */ true, clearBuffer,
safeMargin);`

to ensure the fixes proposed in this PR were taken into effect and being
used during manual testing. Tested content is from the reported bug,
located here:
#4308 (comment)

Closes #4308
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: HLS The issue involves Apple's HLS manifest format 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.

A/V sync problems with unaligned HLS streams
3 participants