diff SDL_sound.c @ 223:249186e31431

Sound_Rewind() support code.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 17 Jan 2002 20:55:46 +0000
parents ca3483f4cfec
children 57e16a6d244f
line wrap: on
line diff
--- a/SDL_sound.c	Thu Jan 17 20:54:46 2002 +0000
+++ b/SDL_sound.c	Thu Jan 17 20:55:46 2002 +0000
@@ -782,5 +782,25 @@
     return(newBufSize);
 } /* Sound_DecodeAll */
 
+
+int Sound_Rewind(Sound_Sample *sample)
+{
+    Sound_SampleInternal *internal;
+    BAIL_IF_MACRO(!initialized, ERR_NOT_INITIALIZED, 0);
+
+    internal = (Sound_SampleInternal *) sample->opaque;
+    if (!internal->funcs->rewind(sample))
+    {
+        sample->flags |= SOUND_SAMPLEFLAG_ERROR;
+        return(0);
+    } /* if */
+
+    sample->flags &= !SOUND_SAMPLEFLAG_EAGAIN;
+    sample->flags &= !SOUND_SAMPLEFLAG_ERROR;
+    sample->flags &= !SOUND_SAMPLEFLAG_EOF;
+    return(1);
+} /* Sound_Rewind */
+
+
 /* end of SDL_sound.c ... */