Skip to content

Conversation

@robertbryer
Copy link
Contributor

This PR fixes two issues with using the preload() function and discharging before it's filled up until buffer target:

  1. If a video element is attached while it's still pre-loading content, the fragments appended from the discharge() function in BufferController send bytes_appended events out. This causes the scheduling loop to be triggered a second time, meaning remaining fragments will be downloaded 2 at time until buffer target is reached. To fix it, the fragments discharged from the PreBufferSink are tracked in array dischargeFragments and bytes_appended events are not sent out for those fragments.
  2. If an init segment is discharged it is appended to the SourceBuffer twice. The discharge function checks the InitCache when chunk is an init segment. It returns the exact same init segment as initChunk, and so it gets appended twice to the source buffer.

You can reproduce both of these by calling preload and attaching a video element quickly after, before you reach the buffer target.

@dsilhavy dsilhavy added this to the 3.2.1 milestone Feb 8, 2021
@dsilhavy dsilhavy self-requested a review February 8, 2021 10:11
@dsilhavy dsilhavy merged commit 4ea2736 into Dash-Industry-Forum:development Feb 8, 2021
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.

2 participants