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 #3384 Multiple Seek Backwards (e.g. Drag) #3479

Merged
merged 1 commit into from
Jun 21, 2021

Conversation

Wayne-Morgan
Copy link
Contributor

Description

Fixes #3384

streaming_engine maintains a reference to ongoing fetch operations for
video, audio and text segments. Using these references, the fetch
operations may be cancelled (e.g. due to a seek).
Immediately following a seek, fetch operations were started for init
segments and media segments. Upon completion of the init segment
operation the reference to the media segment operation was overwritten
with null, so could not be cancelled.

This was particularly evident on platforms where the seek bar is
dragged, as this produces multiple seeks. When dragging backwards it
was possible for the buffer to contain segments beyond the play head.

The solution is to await completion of the init segment fetch before
starting the media segment fetch.

Type of change

  • [X ] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

Checklist:

  • [x ] I have signed the Google CLA https://cla.developers.google.com
  • [ x] My code follows the style guidelines of this project
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • [ x] I have verified my change on multiple browsers on different platforms
  • [ x] I have run ./build/all.py and the build passes
  • [ x] I have run ./build/test.py and all tests pass

streaming_engine maintains a reference to ongoing fetch operations for
video, audio and text segments. Using these references, the fetch
operations may be cancelled (e.g. due to a seek).
Immediately following a seek, fetch operations were started for init
segments and media segments. Upon completion of the init segment
operation the reference to the media segment operation was overwritten
with null, so could not be cancelled.

This was particularly evident on platforms where the seek bar is
dragged, as this produces multiple seeks. When dragging backwards it
was possible for the buffer to contain segments beyond the play head.

The solution is to await completion of the init segment fetch before
starting the media segment fetch.
Copy link
Member

@joeyparrish joeyparrish left a comment

Choose a reason for hiding this comment

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

Thank you!

@shaka-bot
Copy link
Collaborator

All tests passed!

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

Thanks for your contributions!

@Wayne-Morgan Wayne-Morgan deleted the fix-dragback-seek branch June 22, 2021 08:14
joeyparrish pushed a commit that referenced this pull request Jul 13, 2021
streaming_engine maintains a reference to ongoing fetch operations for
video, audio and text segments. Using these references, the fetch
operations may be cancelled (e.g. due to a seek).
Immediately following a seek, fetch operations were started for init
segments and media segments. Upon completion of the init segment
operation the reference to the media segment operation was overwritten
with null, so could not be cancelled.

This was particularly evident on platforms where the seek bar is
dragged, as this produces multiple seeks. When dragging backwards it
was possible for the buffer to contain segments beyond the play head.

The solution is to await completion of the init segment fetch before
starting the media segment fetch.

Fixed #3384
joeyparrish pushed a commit that referenced this pull request Jul 13, 2021
streaming_engine maintains a reference to ongoing fetch operations for
video, audio and text segments. Using these references, the fetch
operations may be cancelled (e.g. due to a seek).
Immediately following a seek, fetch operations were started for init
segments and media segments. Upon completion of the init segment
operation the reference to the media segment operation was overwritten
with null, so could not be cancelled.

This was particularly evident on platforms where the seek bar is
dragged, as this produces multiple seeks. When dragging backwards it
was possible for the buffer to contain segments beyond the play head.

The solution is to await completion of the init segment fetch before
starting the media segment fetch.

Fixed #3384

Backported to v3.0.x

Change-Id: I2bd23ad1abc430e3f0cc413fb1aca863cb967356
@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.

Failure to resume playback with Drag seek backwards (multiple seeks in quick succession)
3 participants