Mercurial > repos > blastem
comparison render_sdl.c @ 1981:3537514ea206
Go back to unpausing audio in render_video_loop to ensure the core is no longer running on the main thread when audio callbacks start when using run on audio thread mode
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 12 May 2020 19:22:09 -0700 |
parents | 81df9aa2de9b |
children | 66f08024d9e9 |
comparison
equal
deleted
inserted
replaced
1980:81df9aa2de9b | 1981:3537514ea206 |
---|---|
169 SDL_DestroyCond(opaque); | 169 SDL_DestroyCond(opaque); |
170 } | 170 } |
171 | 171 |
172 void render_audio_created(audio_source *source) | 172 void render_audio_created(audio_source *source) |
173 { | 173 { |
174 if (render_is_audio_sync()) { | 174 if (sync_src == SYNC_AUDIO) { |
175 SDL_PauseAudio(0); | 175 SDL_PauseAudio(0); |
176 } | 176 } |
177 if (current_system && sync_src == SYNC_AUDIO_THREAD) { | 177 if (current_system && sync_src == SYNC_AUDIO_THREAD) { |
178 system_request_exit(current_system, 0); | 178 system_request_exit(current_system, 0); |
179 } | 179 } |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 void render_source_resumed(audio_source *src) | 195 void render_source_resumed(audio_source *src) |
196 { | 196 { |
197 if (render_is_audio_sync()) { | 197 if (sync_src == SYNC_AUDIO) { |
198 SDL_PauseAudio(0); | 198 SDL_PauseAudio(0); |
199 } | 199 } |
200 if (current_system && sync_src == SYNC_AUDIO_THREAD) { | 200 if (current_system && sync_src == SYNC_AUDIO_THREAD) { |
201 system_request_exit(current_system, 0); | 201 system_request_exit(current_system, 0); |
202 } | 202 } |
1704 void render_video_loop(void) | 1704 void render_video_loop(void) |
1705 { | 1705 { |
1706 if (sync_src != SYNC_AUDIO_THREAD && sync_src != SYNC_EXTERNAL) { | 1706 if (sync_src != SYNC_AUDIO_THREAD && sync_src != SYNC_EXTERNAL) { |
1707 return; | 1707 return; |
1708 } | 1708 } |
1709 SDL_PauseAudio(0); | |
1709 SDL_LockMutex(frame_mutex); | 1710 SDL_LockMutex(frame_mutex); |
1710 for(;;) | 1711 for(;;) |
1711 { | 1712 { |
1712 while (!frame_queue_len && SDL_GetAudioStatus() == SDL_AUDIO_PLAYING) | 1713 while (!frame_queue_len && SDL_GetAudioStatus() == SDL_AUDIO_PLAYING) |
1713 { | 1714 { |