summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd
diff options
context:
space:
mode:
author holub <andrei.holub@gmail.com>2023-07-24 20:38:18 -0400
committer GitHub <noreply@github.com>2023-07-24 20:38:18 -0400
commitc2a516abd4915ed79771a91a262264e6a689ccdf (patch)
tree84c62ae00454f24a828fa51b28e202e3fc421362 /src/osd
parentd7551fdb6938afaf3ebe79e2576b3646937cd7d8 (diff)
js_sound.js: fix sound level default for underrunning case (#11317)
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/modules/sound/js_sound.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/osd/modules/sound/js_sound.js b/src/osd/modules/sound/js_sound.js
index 5cbcc380c1b..571a5227f2b 100644
--- a/src/osd/modules/sound/js_sound.js
+++ b/src/osd/modules/sound/js_sound.js
@@ -173,10 +173,11 @@ function tick (event) {
start = 0;
}
}
- //Pad with silence if we're underrunning:
+ //Pad with latest if we're underrunning:
+ var idx = (index == 0 ? bufferSize : index) - 1;
while (index < 4096) {
- buffers[0][index] = 0;
- buffers[1][index++] = 0;
+ buffers[0][index] = buffers[0][idx];
+ buffers[1][index++] = buffers[1][idx];
}
//Deep inside the bowels of vendors bugs,
//we're using watchdog for a firefox bug,