Commit 07a2d71e90d8c3dc67f2301cdc88756d3d846dba

Charlie Birks 2021-03-30T11:56:38

emscripten: Feed silence to device when paused

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/audio/emscripten/SDL_emscriptenaudio.c b/src/audio/emscripten/SDL_emscriptenaudio.c
index 5bcb48b..67f1cc3 100644
--- a/src/audio/emscripten/SDL_emscriptenaudio.c
+++ b/src/audio/emscripten/SDL_emscriptenaudio.c
@@ -59,6 +59,9 @@ HandleAudioProcess(_THIS)
         if (this->stream) {
             SDL_AudioStreamClear(this->stream);
         }
+
+        SDL_memset(this->work_buffer, this->spec.silence, this->spec.size);
+        FeedAudioDevice(this, this->work_buffer, this->spec.size);
         return;
     }