mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-13 22:08:34 +00:00
[EMSCRIPTEN] remove chrome workaround in RWebAudio, it didn't actually activate or work well anyway
This commit is contained in:
parent
8a617ffa0b
commit
e03114b880
@ -17,19 +17,12 @@ var LibraryRWebAudio = {
|
||||
setStartTime: function() {
|
||||
if (RA.context.currentTime) {
|
||||
RA.startTime = window['performance']['now']() - RA.context.currentTime * 1000;
|
||||
var time1 = RA.context.currentTime;
|
||||
_usleep(50);
|
||||
if (time1 === RA.context.currentTime) {
|
||||
RA.currentTimeWorkaround = true;
|
||||
if (RA.startTime === 0) throw 'startTime is 0';
|
||||
}
|
||||
Module["resumeMainLoop"]();
|
||||
} else window['setTimeout'](RA.setStartTime, 0);
|
||||
},
|
||||
|
||||
getCurrentPerfTime: function() {
|
||||
if (!RA.currentTimeWorkaround) return RA.context.currentTime;
|
||||
else if (RA.startTime) return (window['performance']['now']() - RA.startTime) / 1000;
|
||||
if (RA.startTime) return (window['performance']['now']() - RA.startTime) / 1000;
|
||||
else throw 'getCurrentPerfTime() called before start time set';
|
||||
},
|
||||
|
||||
@ -66,7 +59,7 @@ var LibraryRWebAudio = {
|
||||
var startTime;
|
||||
if (RA.bufIndex) startTime = RA.buffers[RA.bufIndex - 1].endTime;
|
||||
else startTime = RA.context.currentTime;
|
||||
RA.buffers[index].endTime = startTime + RA.buffers[index].duration;
|
||||
RA.buffers[index].endTime = RA.getCurrentPerfTime() + RA.buffers[index].duration;
|
||||
|
||||
var bufferSource = RA.context.createBufferSource();
|
||||
bufferSource.buffer = RA.buffers[index];
|
||||
|
Loading…
Reference in New Issue
Block a user