Mercurial > SDL_sound_CoreAudio
comparison decoders/au.c @ 387:fb519e6028e3
Changed all the Sound_SetError() calls to __Sound_SetError (or BAIL*_MACRO)
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Fri, 05 Jul 2002 23:11:51 +0000 |
parents | cbb15ecf423a |
children | c66080364dff 45ee760a6f5a |
comparison
equal
deleted
inserted
replaced
386:8c8ecd1008c9 | 387:fb519e6028e3 |
---|---|
169 int skip, hsize, i; | 169 int skip, hsize, i; |
170 struct au_file_hdr hdr; | 170 struct au_file_hdr hdr; |
171 struct audec *dec; | 171 struct audec *dec; |
172 char c; | 172 char c; |
173 | 173 |
174 if (!read_au_header(rw, &hdr)) /* does byte order swapping. */ | 174 /* read_au_header() will do byte order swapping. */ |
175 { | 175 BAIL_IF_MACRO(!read_au_header(rw, &hdr), "AU: bad header", 0); |
176 Sound_SetError("AU: Not an .au file (bad header)"); | |
177 return(0); | |
178 } /* if */ | |
179 | 176 |
180 dec = malloc(sizeof *dec); | 177 dec = malloc(sizeof *dec); |
181 BAIL_IF_MACRO(dec == NULL, ERR_OUT_OF_MEMORY, 0); | 178 BAIL_IF_MACRO(dec == NULL, ERR_OUT_OF_MEMORY, 0); |
182 internal->decoder_private = dec; | 179 internal->decoder_private = dec; |
183 | 180 |
201 case AU_ENC_LINEAR_16: | 198 case AU_ENC_LINEAR_16: |
202 sample->actual.format = AUDIO_S16MSB; | 199 sample->actual.format = AUDIO_S16MSB; |
203 break; | 200 break; |
204 | 201 |
205 default: | 202 default: |
206 Sound_SetError("AU: Unsupported .au encoding"); | |
207 free(dec); | 203 free(dec); |
208 return 0; | 204 BAIL_MACRO("AU: Unsupported .au encoding", 0); |
209 } /* switch */ | 205 } /* switch */ |
210 | 206 |
211 sample->actual.rate = hdr.sample_rate; | 207 sample->actual.rate = hdr.sample_rate; |
212 sample->actual.channels = hdr.channels; | 208 sample->actual.channels = hdr.channels; |
213 dec->remaining = hdr.data_size; | 209 dec->remaining = hdr.data_size; |
242 sample->actual.channels = 1; | 238 sample->actual.channels = 1; |
243 } /* else if */ | 239 } /* else if */ |
244 | 240 |
245 else | 241 else |
246 { | 242 { |
247 Sound_SetError("AU: Not an .AU stream."); | |
248 free(dec); | 243 free(dec); |
249 return(0); | 244 BAIL_MACRO("AU: Not an .AU stream.", 0); |
250 } /* else */ | 245 } /* else */ |
251 | 246 |
252 sample->flags = SOUND_SAMPLEFLAG_CANSEEK; | 247 sample->flags = SOUND_SAMPLEFLAG_CANSEEK; |
253 dec->total = dec->remaining; | 248 dec->total = dec->remaining; |
254 dec->start_offset = SDL_RWtell(rw); | 249 dec->start_offset = SDL_RWtell(rw); |