comparison decoders/raw.c @ 221:c9772a9f5271

Initial implementation or stubs for rewind method. Other cleanups.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 17 Jan 2002 20:53:53 +0000
parents 47cc2de2ae36
children c97be6e1bd27
comparison
equal deleted inserted replaced
220:ef72f3c490e7 221:c9772a9f5271
57 static int RAW_init(void); 57 static int RAW_init(void);
58 static void RAW_quit(void); 58 static void RAW_quit(void);
59 static int RAW_open(Sound_Sample *sample, const char *ext); 59 static int RAW_open(Sound_Sample *sample, const char *ext);
60 static void RAW_close(Sound_Sample *sample); 60 static void RAW_close(Sound_Sample *sample);
61 static Uint32 RAW_read(Sound_Sample *sample); 61 static Uint32 RAW_read(Sound_Sample *sample);
62 static int RAW_rewind(Sound_Sample *sample);
62 63
63 static const char *extensions_raw[] = { "RAW", NULL }; 64 static const char *extensions_raw[] = { "RAW", NULL };
64 const Sound_DecoderFunctions __Sound_DecoderFunctions_RAW = 65 const Sound_DecoderFunctions __Sound_DecoderFunctions_RAW =
65 { 66 {
66 { 67 {
68 "Raw audio", 69 "Raw audio",
69 "Ryan C. Gordon <icculus@clutteredmind.org>", 70 "Ryan C. Gordon <icculus@clutteredmind.org>",
70 "http://www.icculus.org/SDL_sound/" 71 "http://www.icculus.org/SDL_sound/"
71 }, 72 },
72 73
73 RAW_init, /* init() method */ 74 RAW_init, /* init() method */
74 RAW_quit, /* quit() method */ 75 RAW_quit, /* quit() method */
75 RAW_open, /* open() method */ 76 RAW_open, /* open() method */
76 RAW_close, /* close() method */ 77 RAW_close, /* close() method */
77 RAW_read /* read() method */ 78 RAW_read, /* read() method */
79 RAW_rewind /* rewind() method */
78 }; 80 };
79 81
80 82
81 static int RAW_init(void) 83 static int RAW_init(void)
82 { 84 {
157 sample->flags |= SOUND_SAMPLEFLAG_EAGAIN; 159 sample->flags |= SOUND_SAMPLEFLAG_EAGAIN;
158 160
159 return(retval); 161 return(retval);
160 } /* RAW_read */ 162 } /* RAW_read */
161 163
164
165 static int RAW_rewind(Sound_Sample *sample)
166 {
167 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque;
168 BAIL_IF_MACRO(SDL_RWseek(internal->rw, 0, SEEK_SET) != 0, ERR_IO_ERROR, 0);
169 return(1);
170 } /* RAW_rewind */
171
172
162 #endif /* SOUND_SUPPORTS_RAW */ 173 #endif /* SOUND_SUPPORTS_RAW */
163 174
164 175
165 /* end of raw.c ... */ 176 /* end of raw.c ... */
166 177