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: selectVariantTrack doesn't clear buffer if already selected #3477

Merged

Conversation

avelad
Copy link
Member

@avelad avelad commented Jun 21, 2021

Close: #3450

@@ -318,7 +318,7 @@ shaka.media.StreamingEngine = class {
* @param {boolean=} clearBuffer
* @param {number=} safeMargin
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Would you please add "force" to the param list?
  2. Would you please leave a comment to explain how "force" works with "clearBuffer"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@shaka-bot
Copy link
Collaborator

All tests passed!

@joeyparrish joeyparrish merged commit e85009d into shaka-project:master Jun 21, 2021
@joeyparrish
Copy link
Member

Thanks for your contributions!

@aradalvand
Copy link

aradalvand commented Jun 21, 2021

Thanks for this. Was adding a new parameter necessary though? Couldn't this be the default behavior when clearBuffer is true? As @TheModMaker had said in #3450:

I guess we should probably always clear the buffer if the clearBuffer argument is set. This may result in some extra work if the app calls for an already-selected track; but it is probably more correct to trust the app and clear the buffer.

@joeyparrish
Copy link
Member

Thanks for this. Was adding a new parameter necessary though? Couldn't this be the default behavior when clearBuffer is true?

Yes, and yes. The new parameter was on an internal class (StreamingEngine), not on selectVariantTrack. When clearBuffer is true on selectVariantTrack, it now does what you would expect. It uses this new internal parameter on StreamingEngine to do the job.

@aradalvand
Copy link

@joeyparrish Oh yeah, that's right, sorry! I mistakenly thought the new parameter was on selectVariantTrack.
Thanks!

@joeyparrish
Copy link
Member

No problem! It's an easy mistake to make. Thanks for using Shaka Player!

@avelad avelad deleted the clear-buffer-selectVariantTrack branch June 22, 2021 05:53
joeyparrish pushed a commit that referenced this pull request Jul 13, 2021
…3477)

Close: #3450

Backported to v3.0.x

Change-Id: I1c4a8e3465ab5cf9bd2b07c485387966ffc09e6f
@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
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

selectVariantTrack doesn't clear buffer if already selected
5 participants