comparison decoders/speex.c @ 510:1841bdcf2122

Completely unacceptable hack for Speex rewinding.
author Ryan C. Gordon <icculus@icculus.org>
date Fri, 31 Mar 2006 07:20:09 +0000
parents 6bd7ca7d218b
children 2df1f5c62d38
comparison
equal deleted inserted replaced
506:6ae286a80da5 510:1841bdcf2122
417 } /* SPEEX_read */ 417 } /* SPEEX_read */
418 418
419 419
420 static int SPEEX_rewind(Sound_Sample *sample) 420 static int SPEEX_rewind(Sound_Sample *sample)
421 { 421 {
422 /* !!! FIXME */ return(0); 422 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
423 /*
424 * !!! FIXME: This is really unacceptable; state should be reset and
425 * !!! FIXME: the RWops should be pointed to the start of the data
426 * !!! FIXME: to decode. The below kludge adds unneeded overhead and
427 * !!! FIXME: risk of failure.
428 */
429 BAIL_IF_MACRO(SDL_RWseek(internal->rw, 0, SEEK_SET) != 0, ERR_IO_ERROR, 0);
430 SPEEX_close(sample);
431 return(SPEEX_open(sample, "SPX"));
423 } /* SPEEX_rewind */ 432 } /* SPEEX_rewind */
424 433
425 434
426 static int SPEEX_seek(Sound_Sample *sample, Uint32 ms) 435 static int SPEEX_seek(Sound_Sample *sample, Uint32 ms)
427 { 436 {