diff options
author | James Taylor <user234683@users.noreply.github.com> | 2021-08-28 09:23:19 -0700 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-08-29 22:48:46 -0500 |
commit | 9d3ebca622f7eddd3539e4532957dcf8487feb72 (patch) | |
tree | fdf81dd05b9f4903918ce657361f6b13099c65d5 /youtube/static/js | |
parent | ef867e3759ef417c51adb156c3636b9ada51e48c (diff) | |
download | yt-local-9d3ebca622f7eddd3539e4532957dcf8487feb72.tar.lz yt-local-9d3ebca622f7eddd3539e4532957dcf8487feb72.tar.xz yt-local-9d3ebca622f7eddd3539e4532957dcf8487feb72.zip |
av-merge: End stream correctly when last segments do not overlap
In this video at 480p:
https://www.youtube.com/watch?v=6bnanI9jXps
There is an extremely tiny audio segment from
30.00018140589569 to 30.06981859410431
after the last video segment ends at 29.99998888888889. Call
end of stream when we have all segments until the end, instead
of calling it when we are playing the last segment.
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'youtube/static/js')
-rw-r--r-- | youtube/static/js/av-merge.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/youtube/static/js/av-merge.js b/youtube/static/js/av-merge.js index f6ea007..84e121c 100644 --- a/youtube/static/js/av-merge.js +++ b/youtube/static/js/av-merge.js @@ -283,10 +283,9 @@ Stream.prototype.checkBuffer = async function() { if (i < this.sidx.entries.length && !this.sidx.entries[i].requested) { this.fetchSegment(i); - // We are playing the last segment and we have it. + // We have all the segments until the end // Signal the end of stream - } else if (currentSegmentIdx == this.sidx.entries.length - 1 - && this.sidx.entries[currentSegmentIdx].have) { + } else if (i == this.sidx.entries.length) { if (this.streamType == 'audio') this.avMerge.audioEndOfStream(); else |