comparison decoders/mpglib.c @ 351:069ce624d6cf

FIXME cleanup.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 06 Jun 2002 19:12:13 +0000
parents 31cc49d7d0ce
children f11c10ffa31a
comparison
equal deleted inserted replaced
350:cafdbcae733d 351:069ce624d6cf
142 BAIL_MACRO("MP3: Could not read MP3 magic.", 0); 142 BAIL_MACRO("MP3: Could not read MP3 magic.", 0);
143 143
144 if (mp3_magic[0] != 0xFF || (mp3_magic[1] & 0xF0) != 0xF0) 144 if (mp3_magic[0] != 0xFF || (mp3_magic[1] & 0xF0) != 0xF0)
145 BAIL_MACRO("MP3: Not an MP3 stream.", 0); 145 BAIL_MACRO("MP3: Not an MP3 stream.", 0);
146 146
147 /* !!! FIXME: If the seek fails, we'll probably miss a frame */ 147 /* If the seek fails, we'll probably miss a frame, but oh well. */
148 SDL_RWseek(internal->rw, -sizeof (mp3_magic), SEEK_CUR); 148 SDL_RWseek(internal->rw, -sizeof (mp3_magic), SEEK_CUR);
149 } /* if */ 149 } /* if */
150 150
151 mpg = (mpglib_t *) malloc(sizeof (mpglib_t)); 151 mpg = (mpglib_t *) malloc(sizeof (mpglib_t));
152 BAIL_IF_MACRO(mpg == NULL, ERR_OUT_OF_MEMORY, 0); 152 BAIL_IF_MACRO(mpg == NULL, ERR_OUT_OF_MEMORY, 0);
168 BAIL_MACRO("MPGLIB: Not an MP3 stream?", 0); 168 BAIL_MACRO("MPGLIB: Not an MP3 stream?", 0);
169 } /* if */ 169 } /* if */
170 170
171 SNDDBG(("MPGLIB: Accepting data stream.\n")); 171 SNDDBG(("MPGLIB: Accepting data stream.\n"));
172 172
173 /* !!! FIXME: Determine what format mpglib is spitting out... */
174 internal->decoder_private = mpg; 173 internal->decoder_private = mpg;
175 sample->actual.rate = mpglib_freqs[mpg->mp.fr.sampling_frequency]; 174 sample->actual.rate = mpglib_freqs[mpg->mp.fr.sampling_frequency];
176 sample->actual.channels = mpg->mp.fr.stereo; 175 sample->actual.channels = mpg->mp.fr.stereo;
177 sample->actual.format = AUDIO_S16SYS; /* !!! FIXME: Is this right? */ 176 sample->actual.format = AUDIO_S16SYS;
178 sample->flags = SOUND_SAMPLEFLAG_NONE; 177 sample->flags = SOUND_SAMPLEFLAG_NONE;
179 178
180 return(1); /* we'll handle this data. */ 179 return(1); /* we'll handle this data. */
181 } /* MPGLIB_open */ 180 } /* MPGLIB_open */
182 181
288 } /* MPGLIB_rewind */ 287 } /* MPGLIB_rewind */
289 288
290 289
291 static int MPGLIB_seek(Sound_Sample *sample, Uint32 ms) 290 static int MPGLIB_seek(Sound_Sample *sample, Uint32 ms)
292 { 291 {
293 BAIL_MACRO("!!! FIXME: Not implemented", 0); 292 BAIL_MACRO("MPGLIB: Seeking not implemented", 0);
294 } /* MPGLIB_seek */ 293 } /* MPGLIB_seek */
295 294
296 #endif /* SOUND_SUPPORTS_MPGLIB */ 295 #endif /* SOUND_SUPPORTS_MPGLIB */
297 296
298 297