# HG changeset patch # User Ryan C. Gordon # Date 1143789609 0 # Node ID 1841bdcf2122af1c29b7fcb44cba6847591cf023 # Parent 6ae286a80da52d7d87e9ae7dc7c8e32f5e89fdce Completely unacceptable hack for Speex rewinding. diff -r 6ae286a80da5 -r 1841bdcf2122 decoders/speex.c --- a/decoders/speex.c Sat Dec 17 18:49:41 2005 +0000 +++ b/decoders/speex.c Fri Mar 31 07:20:09 2006 +0000 @@ -419,7 +419,16 @@ static int SPEEX_rewind(Sound_Sample *sample) { - /* !!! FIXME */ return(0); + Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; + /* + * !!! FIXME: This is really unacceptable; state should be reset and + * !!! FIXME: the RWops should be pointed to the start of the data + * !!! FIXME: to decode. The below kludge adds unneeded overhead and + * !!! FIXME: risk of failure. + */ + BAIL_IF_MACRO(SDL_RWseek(internal->rw, 0, SEEK_SET) != 0, ERR_IO_ERROR, 0); + SPEEX_close(sample); + return(SPEEX_open(sample, "SPX")); } /* SPEEX_rewind */