summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Everton <dan@iocaine.org>2009-06-17 07:55:50 +0000
committerDan Everton <dan@iocaine.org>2009-06-17 07:55:50 +0000
commit72c65d7575cdf9277a27a5baf18eb013c629d223 (patch)
treea5d1a0cec4ff0f0d586a4a80927d1075486452bd
parentf2a8dd3ce554ba900273c450ea645630efe2bbcb (diff)
downloadrockbox-72c65d7575cdf9277a27a5baf18eb013c629d223.tar.gz
rockbox-72c65d7575cdf9277a27a5baf18eb013c629d223.zip
Commit FS#10324 from Jeffrey Goode.
Close the debug audio stream in the simulator when playback is stopped to allow the file to be opened by other programs. This would mostly have been an issue on Windows. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21315 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--docs/CREDITS1
-rw-r--r--uisimulator/sdl/sound.c13
2 files changed, 13 insertions, 1 deletions
diff --git a/docs/CREDITS b/docs/CREDITS
index ce2f0ed3f8..74774f1098 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -471,6 +471,7 @@ Vytenis Sabelka
471Nicolas Pitre 471Nicolas Pitre
472Benedikt Goos 472Benedikt Goos
473Frederick Full 473Frederick Full
474Jeffrey Goode
474 475
475The libmad team 476The libmad team
476The wavpack team 477The wavpack team
diff --git a/uisimulator/sdl/sound.c b/uisimulator/sdl/sound.c
index 39abc85aca..428983a1b8 100644
--- a/uisimulator/sdl/sound.c
+++ b/uisimulator/sdl/sound.c
@@ -96,6 +96,11 @@ void pcm_play_dma_start(const void *addr, size_t size)
96void pcm_play_dma_stop(void) 96void pcm_play_dma_stop(void)
97{ 97{
98 SDL_PauseAudio(1); 98 SDL_PauseAudio(1);
99 if (udata.debug != NULL) {
100 fclose(udata.debug);
101 udata.debug = NULL;
102 DEBUGF("Audio debug file closed\n");
103 }
99} 104}
100 105
101void pcm_play_dma_pause(bool pause) 106void pcm_play_dma_pause(bool pause)
@@ -113,6 +118,11 @@ size_t pcm_get_bytes_waiting(void)
113 118
114extern int sim_volume; /* in firmware/sound.c */ 119extern int sim_volume; /* in firmware/sound.c */
115void write_to_soundcard(struct pcm_udata *udata) { 120void write_to_soundcard(struct pcm_udata *udata) {
121 if (debug_audio && (udata->debug == NULL)) {
122 udata->debug = fopen("audiodebug.raw", "ab");
123 DEBUGF("Audio debug file open\n");
124 }
125
116 if (cvt.needed) { 126 if (cvt.needed) {
117 Uint32 rd = udata->num_in; 127 Uint32 rd = udata->num_in;
118 Uint32 wr = (double)rd * cvt.len_ratio; 128 Uint32 wr = (double)rd * cvt.len_ratio;
@@ -292,8 +302,9 @@ void pcm_play_dma_init(void)
292 302
293 if (debug_audio) { 303 if (debug_audio) {
294 udata.debug = fopen("audiodebug.raw", "wb"); 304 udata.debug = fopen("audiodebug.raw", "wb");
305 DEBUGF("Audio debug file open\n");
295 } 306 }
296 307
297 /* Set 16-bit stereo audio at 44Khz */ 308 /* Set 16-bit stereo audio at 44Khz */
298 wanted_spec.freq = 44100; 309 wanted_spec.freq = 44100;
299 wanted_spec.format = AUDIO_S16SYS; 310 wanted_spec.format = AUDIO_S16SYS;