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
This commit is contained in:
parent
f2a8dd3ce5
commit
72c65d7575
2 changed files with 13 additions and 1 deletions
|
@ -471,6 +471,7 @@ Vytenis Sabelka
|
||||||
Nicolas Pitre
|
Nicolas Pitre
|
||||||
Benedikt Goos
|
Benedikt Goos
|
||||||
Frederick Full
|
Frederick Full
|
||||||
|
Jeffrey Goode
|
||||||
|
|
||||||
The libmad team
|
The libmad team
|
||||||
The wavpack team
|
The wavpack team
|
||||||
|
|
|
@ -96,6 +96,11 @@ void pcm_play_dma_start(const void *addr, size_t size)
|
||||||
void pcm_play_dma_stop(void)
|
void pcm_play_dma_stop(void)
|
||||||
{
|
{
|
||||||
SDL_PauseAudio(1);
|
SDL_PauseAudio(1);
|
||||||
|
if (udata.debug != NULL) {
|
||||||
|
fclose(udata.debug);
|
||||||
|
udata.debug = NULL;
|
||||||
|
DEBUGF("Audio debug file closed\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void pcm_play_dma_pause(bool pause)
|
void pcm_play_dma_pause(bool pause)
|
||||||
|
@ -113,6 +118,11 @@ size_t pcm_get_bytes_waiting(void)
|
||||||
|
|
||||||
extern int sim_volume; /* in firmware/sound.c */
|
extern int sim_volume; /* in firmware/sound.c */
|
||||||
void write_to_soundcard(struct pcm_udata *udata) {
|
void write_to_soundcard(struct pcm_udata *udata) {
|
||||||
|
if (debug_audio && (udata->debug == NULL)) {
|
||||||
|
udata->debug = fopen("audiodebug.raw", "ab");
|
||||||
|
DEBUGF("Audio debug file open\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (cvt.needed) {
|
if (cvt.needed) {
|
||||||
Uint32 rd = udata->num_in;
|
Uint32 rd = udata->num_in;
|
||||||
Uint32 wr = (double)rd * cvt.len_ratio;
|
Uint32 wr = (double)rd * cvt.len_ratio;
|
||||||
|
@ -292,6 +302,7 @@ void pcm_play_dma_init(void)
|
||||||
|
|
||||||
if (debug_audio) {
|
if (debug_audio) {
|
||||||
udata.debug = fopen("audiodebug.raw", "wb");
|
udata.debug = fopen("audiodebug.raw", "wb");
|
||||||
|
DEBUGF("Audio debug file open\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set 16-bit stereo audio at 44Khz */
|
/* Set 16-bit stereo audio at 44Khz */
|
||||||
|
|
Loading…
Reference in a new issue