Mercurial > SDL_sound_CoreAudio
changeset 272:0ac181b5adc6
Corrected error reporting to respect Sound_GetError()'s new thread
distinctions and not report predecoding errors twice.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sun, 10 Mar 2002 19:03:56 +0000 |
parents | 493dd0173f3d |
children | e1429f96aded |
files | playsound/playsound.c |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/playsound/playsound.c Sun Mar 10 18:35:31 2002 +0000 +++ b/playsound/playsound.c Sun Mar 10 19:03:56 2002 +0000 @@ -196,6 +196,12 @@ if (!(sample->flags & (SOUND_SAMPLEFLAG_ERROR | SOUND_SAMPLEFLAG_EOF))) { decoded_bytes = Sound_Decode(sample); + if (sample->flags & SOUND_SAMPLEFLAG_ERROR) + { + fprintf(stderr, "Error in decoding sound file!\n" + " reason: [%s].\n", Sound_GetError()); + } /* if */ + decoded_ptr = sample->buffer; return(read_more_data(sample)); /* handle loops conditions. */ } /* if */ @@ -600,12 +606,6 @@ delay = 2 * 1000 * sdl_desired.samples / sdl_desired.freq; SDL_Delay(delay); - if (sample->flags & SOUND_SAMPLEFLAG_ERROR) - { - fprintf(stderr, "Error in decoding sound file!\n" - " reason: [%s].\n", Sound_GetError()); - } /* if */ - SDL_CloseAudio(); /* reopen with next sample's format if possible */ Sound_FreeSample(sample); } /* for */