We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d71e567 commit be8ba03Copy full SHA for be8ba03
stream.cpp
@@ -2252,8 +2252,22 @@ int main(int argc, char ** argv) {
2252
2253
SDL_PauseAudioDevice(g_dev_id_in, 0);
2254
2255
+ bool is_running = true;
2256
+
2257
// main audio loop
- while (true) {
2258
+ while (is_running) {
2259
+ // process SDL events:
2260
+ SDL_Event event;
2261
+ while (SDL_PollEvent(&event)) {
2262
+ switch (event.type) {
2263
+ case SDL_QUIT:
2264
+ is_running = false;
2265
+ break;
2266
+ default:
2267
2268
+ }
2269
2270
2271
// process 3 seconds of new audio
2272
while ((int) SDL_GetQueuedAudioSize(g_dev_id_in) < 3*SAMPLE_RATE*sizeof(float)) {
2273
SDL_Delay(1);
0 commit comments