Commit 1a90c72dfc08730d8e732f81520e690a64467c39

Ryan C. Gordon 2017-01-06T00:49:35

emscriptenaudio: don't get stuck in infinite loop if SDL_AudioStreamPut fails.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/audio/emscripten/SDL_emscriptenaudio.c b/src/audio/emscripten/SDL_emscriptenaudio.c
index 771ccf6..d8a6457 100644
--- a/src/audio/emscripten/SDL_emscriptenaudio.c
+++ b/src/audio/emscripten/SDL_emscriptenaudio.c
@@ -73,6 +73,7 @@ HandleAudioProcess(_THIS)
             if (SDL_AudioStreamPut(this->stream, this->fake_stream, stream_len) == -1) {
                 SDL_AudioStreamClear(this->stream);
                 SDL_AtomicSet(&this->enabled, 0);
+                break;
             }
         }