diff options
author | James Taylor <user234683@users.noreply.github.com> | 2021-08-30 19:53:48 -0700 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-08-31 11:38:24 -0500 |
commit | 30e59081b14c98b49f718a1bc131ac46d09c84bf (patch) | |
tree | 2563f4b1b46f18b8ce8bc15e442fc2e55b952998 /youtube | |
parent | 85cf9438506374a354f34bff68a61f9d7c3db1b3 (diff) | |
download | yt-local-30e59081b14c98b49f718a1bc131ac46d09c84bf.tar.lz yt-local-30e59081b14c98b49f718a1bc131ac46d09c84bf.tar.xz yt-local-30e59081b14c98b49f718a1bc131ac46d09c84bf.zip |
av-merge: Use .shift() instead of .pop() in appendQueue for FIFO
.pop() gives LIFO, but FIFO was the intention for appendQueue.
O(n) behavior is fine because appendQueue should be very small.
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'youtube')
-rw-r--r-- | youtube/static/js/av-merge.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube/static/js/av-merge.js b/youtube/static/js/av-merge.js index 3198857..8a1deb8 100644 --- a/youtube/static/js/av-merge.js +++ b/youtube/static/js/av-merge.js @@ -164,7 +164,7 @@ function Stream(avMerge, source, startTime, avRatio) { }); this.updateendEvt = addEvent(this.sourceBuffer, 'updateend', (e) => { if (this.appendQueue.length != 0) { - this.appendSegment(...this.appendQueue.pop()); + this.appendSegment(...this.appendQueue.shift()); } }); } |