# HG changeset patch # User Ryan C. Gordon # Date 1021877203 0 # Node ID aa7f6a1109716fe45ec4468ae4214ecfbdead250 # Parent 1b33baef9bf96401a55f44a6bfd3d41f5cd4e045 Added seek implementation. diff -r 1b33baef9bf9 -r aa7f6a110971 decoders/ogg.c --- a/decoders/ogg.c Mon May 20 06:40:10 2002 +0000 +++ b/decoders/ogg.c Mon May 20 06:46:43 2002 +0000 @@ -207,7 +207,7 @@ SNDDBG(("OGG: total seconds of sample == (%f).\n", ov_time_total(vf, -1))); internal->decoder_private = vf; - sample->flags = SOUND_SAMPLEFLAG_NONE; + sample->flags = SOUND_SAMPLEFLAG_CANSEEK; sample->actual.rate = (Uint32) info->rate; sample->actual.channels = (Uint8) info->channels; @@ -280,7 +280,11 @@ static int OGG_seek(Sound_Sample *sample, Uint32 ms) { - BAIL_MACRO("!!! FIXME: Not implemented", 0); + Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; + OggVorbis_File *vf = (OggVorbis_File *) internal->decoder_private; + double timepos = (((double) ms) / 1000.0); + BAIL_IF_MACRO(ov_time_seek(vf, timepos) < 0, ERR_IO_ERROR, 0); + return(1); } /* OGG_seek */ #endif /* SOUND_SUPPORTS_OGG */