comparison decoders/au.c @ 257:7c4f6ee02cd0

Changed magic number to be bigendian.
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 11 Feb 2002 08:30:23 +0000
parents c9772a9f5271
children 9828311da44b
comparison
equal deleted inserted replaced
256:c6b7f7999a0e 257:7c4f6ee02cd0
122 Uint32 start_offset; 122 Uint32 start_offset;
123 int encoding; 123 int encoding;
124 }; 124 };
125 125
126 126
127 #define AU_MAGIC 0x646E732E /* ".snd", in ASCII */ 127 #define AU_MAGIC 0x2E736E64 /* ".snd", in ASCII (bigendian number) */
128 128
129 static int AU_open(Sound_Sample *sample, const char *ext) 129 static int AU_open(Sound_Sample *sample, const char *ext)
130 { 130 {
131 Sound_SampleInternal *internal = sample->opaque; 131 Sound_SampleInternal *internal = sample->opaque;
132 SDL_RWops *rw = internal->rw; 132 SDL_RWops *rw = internal->rw;
143 Sound_SetError("No .au file (bad header)"); 143 Sound_SetError("No .au file (bad header)");
144 free(dec); 144 free(dec);
145 return(0); 145 return(0);
146 } /* if */ 146 } /* if */
147 147
148 /* 148 if (SDL_SwapBE32(hdr.magic) == AU_MAGIC)
149 * !!! FIXME: For correctness, we should calculate this as a bigendian
150 * !!! FIXME: number, which means swapping AU_MAGIC around.
151 */
152 if (SDL_SwapLE32(hdr.magic) == AU_MAGIC)
153 { 149 {
154 /* valid magic */ 150 /* valid magic */
155 dec->encoding = SDL_SwapBE32(hdr.encoding); 151 dec->encoding = SDL_SwapBE32(hdr.encoding);
156 switch(dec->encoding) 152 switch(dec->encoding)
157 { 153 {