comparison decoders/au.c @ 294:9828311da44b

Minor cleanups.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 17 Mar 2002 21:17:23 +0000
parents 7c4f6ee02cd0
children c97be6e1bd27
comparison
equal deleted inserted replaced
293:ee6e1f8bfae9 294:9828311da44b
138 internal->decoder_private = dec; 138 internal->decoder_private = dec;
139 139
140 r = SDL_RWread(rw, &hdr, 1, HDR_SIZE); 140 r = SDL_RWread(rw, &hdr, 1, HDR_SIZE);
141 if (r < HDR_SIZE) 141 if (r < HDR_SIZE)
142 { 142 {
143 Sound_SetError("No .au file (bad header)"); 143 Sound_SetError("AU: Not an .au file (bad header)");
144 free(dec); 144 free(dec);
145 return(0); 145 return(0);
146 } /* if */ 146 } /* if */
147 147
148 if (SDL_SwapBE32(hdr.magic) == AU_MAGIC) 148 if (SDL_SwapBE32(hdr.magic) == AU_MAGIC)
165 case AU_ENC_LINEAR_16: 165 case AU_ENC_LINEAR_16:
166 sample->actual.format = AUDIO_S16MSB; 166 sample->actual.format = AUDIO_S16MSB;
167 break; 167 break;
168 168
169 default: 169 default:
170 Sound_SetError("Unsupported .au encoding"); 170 Sound_SetError("AU: Unsupported .au encoding");
171 free(dec); 171 free(dec);
172 return 0; 172 return 0;
173 } /* switch */ 173 } /* switch */
174 174
175 sample->actual.rate = SDL_SwapBE32(hdr.sample_rate); 175 sample->actual.rate = SDL_SwapBE32(hdr.sample_rate);
200 sample->actual.channels = 1; 200 sample->actual.channels = 1;
201 } /* else if */ 201 } /* else if */
202 202
203 else 203 else
204 { 204 {
205 SNDDBG(("AU: Not an .AU stream.\n")); 205 Sound_SetError("AU: Not an .AU stream.");
206 free(dec); 206 free(dec);
207 return(0); 207 return(0);
208 } /* else */ 208 } /* else */
209 209
210 sample->flags = SOUND_SAMPLEFLAG_NONE; 210 sample->flags = SOUND_SAMPLEFLAG_NONE;