aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2021-08-30 19:53:48 -0700
committerJesús <heckyel@hyperbola.info>2021-08-31 11:38:24 -0500
commit30e59081b14c98b49f718a1bc131ac46d09c84bf (patch)
tree2563f4b1b46f18b8ce8bc15e442fc2e55b952998
parent85cf9438506374a354f34bff68a61f9d7c3db1b3 (diff)
downloadyt-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>
-rw-r--r--youtube/static/js/av-merge.js2
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());
}
});
}