Mercurial > SDL_sound_CoreAudio
annotate decoders/flac.c @ 377:cbb15ecf423a
WinCE (PocketPC) patches from Tyler.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Tue, 02 Jul 2002 03:58:24 +0000 |
parents | 498240aa76f1 |
children | fb519e6028e3 |
rev | line source |
---|---|
155 | 1 /* |
2 * SDL_sound -- An abstract sound format decoding API. | |
3 * Copyright (C) 2001 Ryan C. Gordon. | |
4 * | |
5 * This library is free software; you can redistribute it and/or | |
6 * modify it under the terms of the GNU Lesser General Public | |
7 * License as published by the Free Software Foundation; either | |
8 * version 2.1 of the License, or (at your option) any later version. | |
9 * | |
10 * This library is distributed in the hope that it will be useful, | |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 * Lesser General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU Lesser General Public | |
16 * License along with this library; if not, write to the Free Software | |
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 */ | |
19 | |
20 /* | |
21 * FLAC decoder for SDL_sound. | |
22 * | |
23 * This driver handles FLAC audio, that is to say the Free Lossless Audio | |
24 * Codec. It depends on libFLAC for decoding, which can be grabbed from: | |
25 * http://flac.sourceforge.net | |
26 * | |
184
47cc2de2ae36
Changed reference to "LICENSE" file to "COPYING".
Ryan C. Gordon <icculus@icculus.org>
parents:
182
diff
changeset
|
27 * Please see the file COPYING in the source's root directory. |
155 | 28 * |
29 * This file written by Torbjörn Andersson. (d91tan@Update.UU.SE) | |
30 */ | |
31 | |
32 #if HAVE_CONFIG_H | |
33 # include <config.h> | |
34 #endif | |
35 | |
36 #ifdef SOUND_SUPPORTS_FLAC | |
37 | |
38 #include <stdio.h> | |
39 #include <stdlib.h> | |
40 #include <string.h> | |
41 | |
42 #include "SDL_sound.h" | |
43 | |
44 #define __SDL_SOUND_INTERNAL__ | |
45 #include "SDL_sound_internal.h" | |
46 | |
231
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
47 /* |
312 | 48 * FLAC 1.0.1 added a seekable stream decoder. To be able to reuse as much as |
49 * possible of the non-seekable FLAC decoder, we define a set of wrapper | |
50 * macros and typedefs to map onto the right set of functions and data types. | |
51 * | |
52 * An added benefit is that we get identifiers of manageable length. | |
231
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
53 */ |
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
54 |
312 | 55 #if SOUND_SUPPORTS_SEEKABLE_FLAC |
56 | |
57 #include "FLAC/seekable_stream_decoder.h" | |
58 | |
59 #define D_END_OF_STREAM FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM | |
60 | |
61 #define d_new() FLAC__seekable_stream_decoder_new() | |
62 #define d_init(x) FLAC__seekable_stream_decoder_init(x) | |
63 #define d_process_metadata(x) FLAC__seekable_stream_decoder_process_metadata(x) | |
64 #define d_process_one_frame(x) FLAC__seekable_stream_decoder_process_one_frame(x) | |
65 #define d_get_state(x) FLAC__seekable_stream_decoder_get_state(x) | |
66 #define d_finish(x) FLAC__seekable_stream_decoder_finish(x) | |
67 #define d_delete(x) FLAC__seekable_stream_decoder_delete(x) | |
68 #define d_set_read_callback(x, y) FLAC__seekable_stream_decoder_set_read_callback(x, y) | |
69 #define d_set_write_callback(x, y) FLAC__seekable_stream_decoder_set_write_callback(x, y) | |
70 #define d_set_metadata_callback(x, y) FLAC__seekable_stream_decoder_set_metadata_callback(x, y) | |
71 #define d_set_error_callback(x, y) FLAC__seekable_stream_decoder_set_error_callback(x, y) | |
72 #define d_set_client_data(x, y) FLAC__seekable_stream_decoder_set_client_data(x, y) | |
73 | |
74 typedef FLAC__SeekableStreamDecoder decoder_t; | |
75 typedef FLAC__SeekableStreamDecoderReadStatus d_read_status_t; | |
76 | |
77 /* Only in the seekable decoder */ | |
78 | |
79 #define D_SEEK_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK | |
80 #define D_SEEK_STATUS_ERROR FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR | |
81 #define D_TELL_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK | |
82 #define D_TELL_STATUS_ERROR FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR | |
83 #define D_LENGTH_STATUS_OK FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK | |
84 #define D_LENGTH_STATUS_ERROR FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR | |
85 | |
86 #define d_set_seek_callback(x, y) FLAC__seekable_stream_decoder_set_seek_callback(x, y) | |
87 #define d_set_tell_callback(x, y) FLAC__seekable_stream_decoder_set_tell_callback(x, y) | |
88 #define d_set_length_callback(x, y) FLAC__seekable_stream_decoder_set_length_callback(x, y) | |
89 #define d_set_eof_callback(x, y) FLAC__seekable_stream_decoder_set_eof_callback(x, y) | |
90 #define d_seek_absolute(x, y) FLAC__seekable_stream_decoder_seek_absolute(x, y) | |
91 | |
92 typedef FLAC__SeekableStreamDecoderSeekStatus d_seek_status_t; | |
93 typedef FLAC__SeekableStreamDecoderTellStatus d_tell_status_t; | |
94 typedef FLAC__SeekableStreamDecoderLengthStatus d_length_status_t; | |
95 | |
96 #else | |
97 | |
164
77482005beb6
Now includes FLAC/stream_decoder.h instead of FLAC/all.h. More robust
Ryan C. Gordon <icculus@icculus.org>
parents:
155
diff
changeset
|
98 #include "FLAC/stream_decoder.h" |
155 | 99 |
312 | 100 #define D_END_OF_STREAM FLAC__STREAM_DECODER_END_OF_STREAM |
101 | |
102 #define d_new() FLAC__stream_decoder_new() | |
103 #define d_init(x) FLAC__stream_decoder_init(x) | |
104 #define d_process_metadata(x) FLAC__stream_decoder_process_metadata(x) | |
105 #define d_process_one_frame(x) FLAC__stream_decoder_process_one_frame(x) | |
106 #define d_get_state(x) FLAC__stream_decoder_get_state(x) | |
107 #define d_finish(x) FLAC__stream_decoder_finish(x) | |
108 #define d_delete(x) FLAC__stream_decoder_delete(x) | |
109 #define d_set_read_callback(x, y) FLAC__stream_decoder_set_read_callback(x, y) | |
110 #define d_set_write_callback(x, y) FLAC__stream_decoder_set_write_callback(x, y) | |
111 #define d_set_metadata_callback(x, y) FLAC__stream_decoder_set_metadata_callback(x, y) | |
112 #define d_set_error_callback(x, y) FLAC__stream_decoder_set_error_callback(x, y) | |
113 #define d_set_client_data(x, y) FLAC__stream_decoder_set_client_data(x, y) | |
114 | |
115 typedef FLAC__StreamDecoder decoder_t; | |
116 typedef FLAC__StreamDecoderReadStatus d_read_status_t; | |
117 | |
118 /* Only in the non-seekable decoder */ | |
119 | |
120 #define d_reset(x) FLAC__stream_decoder_reset(x) | |
121 | |
122 #endif | |
123 | |
124 /* These are the same for both decoders, so they're just cosmetics. */ | |
125 | |
126 #define D_WRITE_CONTINUE FLAC__STREAM_DECODER_WRITE_CONTINUE | |
127 #define D_READ_END_OF_STREAM FLAC__STREAM_DECODER_READ_END_OF_STREAM | |
128 #define D_READ_ABORT FLAC__STREAM_DECODER_READ_ABORT | |
129 #define D_READ_CONTINUE FLAC__STREAM_DECODER_READ_CONTINUE | |
130 | |
131 #define d_error_status_string FLAC__StreamDecoderErrorStatusString | |
132 | |
133 typedef FLAC__StreamDecoderWriteStatus d_write_status_t; | |
134 typedef FLAC__StreamDecoderErrorStatus d_error_status_t; | |
135 typedef FLAC__StreamMetaData d_metadata_t; | |
136 | |
155 | 137 |
138 static int FLAC_init(void); | |
139 static void FLAC_quit(void); | |
140 static int FLAC_open(Sound_Sample *sample, const char *ext); | |
141 static void FLAC_close(Sound_Sample *sample); | |
142 static Uint32 FLAC_read(Sound_Sample *sample); | |
221
c9772a9f5271
Initial implementation or stubs for rewind method. Other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
184
diff
changeset
|
143 static int FLAC_rewind(Sound_Sample *sample); |
306
c97be6e1bd27
Added framework for Sound_Seek() support.
Ryan C. Gordon <icculus@icculus.org>
parents:
231
diff
changeset
|
144 static int FLAC_seek(Sound_Sample *sample, Uint32 ms); |
155 | 145 |
146 static const char *extensions_flac[] = { "FLAC", "FLA", NULL }; | |
147 | |
148 const Sound_DecoderFunctions __Sound_DecoderFunctions_FLAC = | |
149 { | |
150 { | |
151 extensions_flac, | |
152 "Free Lossless Audio Codec", | |
153 "Torbjörn Andersson <d91tan@Update.UU.SE>", | |
154 "http://flac.sourceforge.net/" | |
155 }, | |
156 | |
221
c9772a9f5271
Initial implementation or stubs for rewind method. Other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
184
diff
changeset
|
157 FLAC_init, /* init() method */ |
c9772a9f5271
Initial implementation or stubs for rewind method. Other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
184
diff
changeset
|
158 FLAC_quit, /* quit() method */ |
c9772a9f5271
Initial implementation or stubs for rewind method. Other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
184
diff
changeset
|
159 FLAC_open, /* open() method */ |
c9772a9f5271
Initial implementation or stubs for rewind method. Other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
184
diff
changeset
|
160 FLAC_close, /* close() method */ |
c9772a9f5271
Initial implementation or stubs for rewind method. Other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
184
diff
changeset
|
161 FLAC_read, /* read() method */ |
306
c97be6e1bd27
Added framework for Sound_Seek() support.
Ryan C. Gordon <icculus@icculus.org>
parents:
231
diff
changeset
|
162 FLAC_rewind, /* rewind() method */ |
c97be6e1bd27
Added framework for Sound_Seek() support.
Ryan C. Gordon <icculus@icculus.org>
parents:
231
diff
changeset
|
163 FLAC_seek /* seek() method */ |
155 | 164 }; |
165 | |
166 /* This is what we store in our internal->decoder_private field. */ | |
167 typedef struct | |
168 { | |
312 | 169 decoder_t *decoder; |
155 | 170 SDL_RWops *rw; |
171 Sound_Sample *sample; | |
172 Uint32 frame_size; | |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
173 Uint8 is_flac; |
312 | 174 |
175 #if !SOUND_SUPPORTS_SEEKABLE_FLAC | |
176 Uint32 data_offset; | |
177 #else | |
178 Uint32 stream_length; | |
179 #endif | |
155 | 180 } flac_t; |
181 | |
182 | |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
183 static void free_flac(flac_t *f) |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
184 { |
312 | 185 d_finish(f->decoder); |
186 d_delete(f->decoder); | |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
187 free(f); |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
188 } /* free_flac */ |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
189 |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
190 |
312 | 191 static d_read_status_t read_callback( |
192 const decoder_t *decoder, FLAC__byte buffer[], | |
155 | 193 unsigned int *bytes, void *client_data) |
194 { | |
195 flac_t *f = (flac_t *) client_data; | |
196 Uint32 retval; | |
197 | |
198 retval = SDL_RWread(f->rw, (Uint8 *) buffer, 1, *bytes); | |
199 | |
200 if (retval == 0) | |
201 { | |
202 *bytes = 0; | |
203 f->sample->flags |= SOUND_SAMPLEFLAG_EOF; | |
312 | 204 return(D_READ_END_OF_STREAM); |
155 | 205 } /* if */ |
206 | |
207 if (retval == -1) | |
208 { | |
209 *bytes = 0; | |
210 f->sample->flags |= SOUND_SAMPLEFLAG_ERROR; | |
312 | 211 return(D_READ_ABORT); |
155 | 212 } /* if */ |
213 | |
214 if (retval < *bytes) | |
215 { | |
216 *bytes = retval; | |
217 f->sample->flags |= SOUND_SAMPLEFLAG_EAGAIN; | |
218 } /* if */ | |
219 | |
312 | 220 return(D_READ_CONTINUE); |
221 } /* read_callback */ | |
155 | 222 |
223 | |
312 | 224 static d_write_status_t write_callback( |
225 const decoder_t *decoder, const FLAC__Frame *frame, | |
155 | 226 const FLAC__int32 *buffer[], void *client_data) |
227 { | |
228 flac_t *f = (flac_t *) client_data; | |
229 Uint32 i, j; | |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
230 Uint32 sample; |
155 | 231 Uint8 *dst; |
232 | |
233 f->frame_size = frame->header.channels * frame->header.blocksize | |
234 * frame->header.bits_per_sample / 8; | |
235 | |
236 if (f->frame_size > f->sample->buffer_size) | |
237 Sound_SetBufferSize(f->sample, f->frame_size); | |
238 | |
239 dst = f->sample->buffer; | |
240 | |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
241 /* If the sample is neither exactly 8-bit nor 16-bit, it will have to |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
242 * be converted. Unfortunately the buffer is read-only, so we either |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
243 * have to check for each sample, or make a copy of the buffer. I'm |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
244 * not sure which way is best, so I've arbitrarily picked the former. |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
245 */ |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
246 if (f->sample->actual.format == AUDIO_S8) |
155 | 247 { |
248 for (i = 0; i < frame->header.blocksize; i++) | |
249 for (j = 0; j < frame->header.channels; j++) | |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
250 { |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
251 sample = buffer[j][i]; |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
252 if (frame->header.bits_per_sample < 8) |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
253 sample <<= (8 - frame->header.bits_per_sample); |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
254 *dst++ = sample & 0x00ff; |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
255 } /* for */ |
155 | 256 } /* if */ |
257 else | |
258 { | |
259 for (i = 0; i < frame->header.blocksize; i++) | |
260 for (j = 0; j < frame->header.channels; j++) | |
261 { | |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
262 sample = buffer[j][i]; |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
263 if (frame->header.bits_per_sample < 16) |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
264 sample <<= (16 - frame->header.bits_per_sample); |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
265 else if (frame->header.bits_per_sample > 16) |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
266 sample >>= (frame->header.bits_per_sample - 16); |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
267 *dst++ = (sample & 0xff00) >> 8; |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
268 *dst++ = sample & 0x00ff; |
155 | 269 } /* for */ |
270 } /* else */ | |
271 | |
312 | 272 return(D_WRITE_CONTINUE); |
273 } /* write_callback */ | |
155 | 274 |
275 | |
312 | 276 static void metadata_callback( |
277 const decoder_t *decoder, | |
278 const d_metadata_t *metadata, | |
155 | 279 void *client_data) |
280 { | |
281 flac_t *f = (flac_t *) client_data; | |
312 | 282 |
155 | 283 SNDDBG(("FLAC: Metadata callback.\n")); |
284 | |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
285 /* There are several kinds of metadata, but STREAMINFO is the only |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
286 * one that always has to be there. |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
287 */ |
155 | 288 if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) |
289 { | |
290 SNDDBG(("FLAC: Metadata is streaminfo.\n")); | |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
291 |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
292 f->is_flac = 1; |
155 | 293 f->sample->actual.channels = metadata->data.stream_info.channels; |
294 f->sample->actual.rate = metadata->data.stream_info.sample_rate; | |
295 | |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
296 if (metadata->data.stream_info.bits_per_sample > 8) |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
297 f->sample->actual.format = AUDIO_S16MSB; |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
298 else |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
299 f->sample->actual.format = AUDIO_S8; |
155 | 300 } /* if */ |
312 | 301 } /* metadata_callback */ |
155 | 302 |
303 | |
312 | 304 static void error_callback( |
305 const decoder_t *decoder, | |
306 d_error_status_t status, | |
155 | 307 void *client_data) |
308 { | |
309 flac_t *f = (flac_t *) client_data; | |
164
77482005beb6
Now includes FLAC/stream_decoder.h instead of FLAC/all.h. More robust
Ryan C. Gordon <icculus@icculus.org>
parents:
155
diff
changeset
|
310 |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
311 /* !!! FIXME: Is every error really fatal? I don't know... */ |
312 | 312 Sound_SetError(d_error_status_string[status]); |
155 | 313 f->sample->flags |= SOUND_SAMPLEFLAG_ERROR; |
312 | 314 } /* error_callback */ |
315 | |
316 | |
317 #if SOUND_SUPPORTS_SEEKABLE_FLAC | |
318 | |
319 static d_seek_status_t seek_callback( | |
320 const decoder_t *decoder, | |
321 FLAC__uint64 absolute_byte_offset, | |
322 void *client_data) | |
323 { | |
324 flac_t *f = (flac_t *) client_data; | |
325 | |
326 if (SDL_RWseek(f->rw, absolute_byte_offset, SEEK_SET) >= 0) | |
327 { | |
328 return(D_SEEK_STATUS_OK); | |
329 } /* if */ | |
330 | |
331 return(D_SEEK_STATUS_ERROR); | |
332 } /* seek_callback*/ | |
333 | |
334 | |
335 static d_tell_status_t tell_callback( | |
336 const decoder_t *decoder, | |
337 FLAC__uint64 *absolute_byte_offset, | |
338 void *client_data) | |
339 { | |
340 flac_t *f = (flac_t *) client_data; | |
341 int pos; /* !!! FIXME: int? Really? */ | |
342 | |
343 pos = SDL_RWtell(f->rw); | |
344 | |
345 if (pos < 0) | |
346 { | |
347 return(D_TELL_STATUS_ERROR); | |
348 } /* if */ | |
155 | 349 |
312 | 350 *absolute_byte_offset = pos; |
351 return(D_TELL_STATUS_OK); | |
352 } /* tell_callback */ | |
353 | |
354 | |
355 static d_length_status_t length_callback( | |
356 const decoder_t *decoder, | |
357 FLAC__uint64 *stream_length, | |
358 void *client_data) | |
359 { | |
360 flac_t *f = (flac_t *) client_data; | |
361 | |
362 if (f->sample->flags & SOUND_SAMPLEFLAG_CANSEEK) | |
363 { | |
364 *stream_length = f->stream_length; | |
365 return(D_LENGTH_STATUS_OK); | |
366 } /* if */ | |
367 | |
368 return(D_LENGTH_STATUS_ERROR); | |
369 } /* length_callback */ | |
370 | |
371 | |
372 static FLAC__bool eof_callback( | |
373 const decoder_t *decoder, | |
374 void *client_data) | |
375 { | |
376 flac_t *f = (flac_t *) client_data; | |
377 int pos; /* !!! FIXME: int? Really? */ | |
378 | |
379 /* Maybe we could check for SOUND_SAMPLEFLAG_EOF here instead? */ | |
380 pos = SDL_RWtell(f->rw); | |
381 | |
382 if (pos >= 0 && pos >= f->stream_length) | |
383 { | |
384 return(true); | |
385 } /* if */ | |
386 | |
387 return(false); | |
388 } /* eof_callback */ | |
389 | |
390 #endif | |
155 | 391 |
392 static int FLAC_init(void) | |
393 { | |
394 return(1); /* always succeeds. */ | |
395 } /* FLAC_init */ | |
396 | |
397 | |
398 static void FLAC_quit(void) | |
399 { | |
400 /* it's a no-op. */ | |
401 } /* FLAC_quit */ | |
402 | |
403 | |
182
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
404 #define FLAC_MAGIC 0x43614C66 /* "fLaC" in ASCII. */ |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
405 |
155 | 406 static int FLAC_open(Sound_Sample *sample, const char *ext) |
407 { | |
408 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; | |
409 SDL_RWops *rw = internal->rw; | |
312 | 410 decoder_t *decoder; |
155 | 411 flac_t *f; |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
412 int i; |
182
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
413 int has_extension = 0; |
312 | 414 |
415 #if SOUND_SUPPORTS_SEEKABLE_FLAC | |
416 Uint32 pos; | |
417 #endif | |
182
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
418 |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
419 /* |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
420 * If the extension is "flac", we'll believe that this is really meant |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
421 * to be a FLAC stream, and will try to grok it from existing metadata. |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
422 * metadata searching can be a very expensive operation, however, so |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
423 * unless the user swears that it is a FLAC stream through the extension, |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
424 * we decide what to do based on the existance of a 32-bit magic number. |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
425 */ |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
426 for (i = 0; extensions_flac[i] != NULL; i++) |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
427 { |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
428 if (__Sound_strcasecmp(ext, extensions_flac[i]) == 0) |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
429 { |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
430 has_extension = 1; |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
431 break; |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
432 } /* if */ |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
433 } /* for */ |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
434 |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
435 if (!has_extension) |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
436 { |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
437 int rc; |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
438 Uint32 flac_magic = SDL_ReadLE32(rw); |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
439 BAIL_IF_MACRO(flac_magic != FLAC_MAGIC, "FLAC: Not a FLAC stream.", 0); |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
440 |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
441 /* move back over magic number for metadata scan... */ |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
442 rc = SDL_RWseek(internal->rw, -sizeof (flac_magic), SEEK_CUR); |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
443 BAIL_IF_MACRO(rc < 0, ERR_IO_ERROR, 0); |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
444 } /* if */ |
155 | 445 |
446 f = (flac_t *) malloc(sizeof (flac_t)); | |
447 BAIL_IF_MACRO(f == NULL, ERR_OUT_OF_MEMORY, 0); | |
448 | |
312 | 449 decoder = d_new(); |
155 | 450 if (decoder == NULL) |
451 { | |
452 Sound_SetError(ERR_OUT_OF_MEMORY); | |
453 free(f); | |
454 return(0); | |
455 } /* if */ | |
456 | |
312 | 457 d_set_read_callback(decoder, read_callback); |
458 d_set_write_callback(decoder, write_callback); | |
459 d_set_metadata_callback(decoder, metadata_callback); | |
460 d_set_error_callback(decoder, error_callback); | |
461 | |
462 #if SOUND_SUPPORTS_SEEKABLE_FLAC | |
463 d_set_seek_callback(decoder, seek_callback); | |
464 d_set_tell_callback(decoder, tell_callback); | |
465 d_set_length_callback(decoder, length_callback); | |
466 d_set_eof_callback(decoder, eof_callback); | |
467 #endif | |
468 | |
469 d_set_client_data(decoder, f); | |
155 | 470 |
471 f->rw = internal->rw; | |
472 f->sample = sample; | |
473 f->decoder = decoder; | |
164
77482005beb6
Now includes FLAC/stream_decoder.h instead of FLAC/all.h. More robust
Ryan C. Gordon <icculus@icculus.org>
parents:
155
diff
changeset
|
474 f->sample->actual.format = 0; |
182
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
475 f->is_flac = 0 /* !!! FIXME: should be "has_extension", not "0". */; |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
476 |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
477 internal->decoder_private = f; |
312 | 478 d_init(decoder); |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
479 |
312 | 480 #if !SOUND_SUPPORTS_SEEKABLE_FLAC |
182
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
481 /* |
231
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
482 * Annoyingly, the rewind method will put the FLAC decoder in a state |
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
483 * where it expects to read metadata, so we have to set this marker |
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
484 * before the metadata block. |
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
485 */ |
312 | 486 f->data_offset = SDL_RWtell(f->rw); |
487 #endif | |
231
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
488 |
312 | 489 sample->flags = SOUND_SAMPLEFLAG_NONE; |
490 | |
491 #if SOUND_SUPPORTS_SEEKABLE_FLAC | |
492 /* | |
493 * FIXME?: For the seekable stream decoder to work, we need to know | |
494 * the length of the stream. This is so ugly... | |
495 */ | |
496 pos = SDL_RWtell(f->rw); | |
497 if (SDL_RWseek(f->rw, 0, SEEK_END)) | |
498 { | |
499 f->stream_length = SDL_RWtell(f->rw); | |
500 SDL_RWseek(f->rw, pos, SEEK_SET); | |
501 sample->flags = SOUND_SAMPLEFLAG_CANSEEK; | |
502 } /* if */ | |
503 #endif | |
504 | |
231
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
505 /* |
182
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
506 * If we are not sure this is a FLAC stream, check for the STREAMINFO |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
507 * metadata block. If not, we'd have to peek at the first audio frame |
182
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
508 * and get the sound format from there, but that is not yet |
3849438b735e
Checks magic number again, unless the file extension is recognized.
Ryan C. Gordon <icculus@icculus.org>
parents:
166
diff
changeset
|
509 * implemented. |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
510 */ |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
511 if (!f->is_flac) |
155 | 512 { |
312 | 513 d_process_metadata(decoder); |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
514 |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
515 /* Still not FLAC? Give up. */ |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
516 if (!f->is_flac) |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
517 { |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
518 Sound_SetError("FLAC: No metadata found. Not a FLAC stream?"); |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
519 free_flac(f); |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
520 return(0); |
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
521 } /* if */ |
155 | 522 } /* if */ |
523 | |
164
77482005beb6
Now includes FLAC/stream_decoder.h instead of FLAC/all.h. More robust
Ryan C. Gordon <icculus@icculus.org>
parents:
155
diff
changeset
|
524 SNDDBG(("FLAC: Accepting data stream.\n")); |
155 | 525 return(1); |
526 } /* FLAC_open */ | |
527 | |
528 | |
529 static void FLAC_close(Sound_Sample *sample) | |
530 { | |
531 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; | |
532 flac_t *f = (flac_t *) internal->decoder_private; | |
533 | |
166
d8904267d23c
Cleanups, fixes and enhancements by Torbj�rn Andersson.
Ryan C. Gordon <icculus@icculus.org>
parents:
164
diff
changeset
|
534 free_flac(f); |
155 | 535 } /* FLAC_close */ |
536 | |
537 | |
538 static Uint32 FLAC_read(Sound_Sample *sample) | |
539 { | |
540 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; | |
541 flac_t *f = (flac_t *) internal->decoder_private; | |
542 Uint32 len; | |
543 | |
312 | 544 if (!d_process_one_frame(f->decoder)) |
155 | 545 { |
164
77482005beb6
Now includes FLAC/stream_decoder.h instead of FLAC/all.h. More robust
Ryan C. Gordon <icculus@icculus.org>
parents:
155
diff
changeset
|
546 Sound_SetError("FLAC: Couldn't decode frame."); |
155 | 547 sample->flags |= SOUND_SAMPLEFLAG_ERROR; |
548 return(0); | |
549 } /* if */ | |
550 | |
312 | 551 if (d_get_state(f->decoder) == D_END_OF_STREAM) |
231
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
552 { |
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
553 sample->flags |= SOUND_SAMPLEFLAG_EOF; |
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
554 return(0); |
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
555 } /* if */ |
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
556 |
164
77482005beb6
Now includes FLAC/stream_decoder.h instead of FLAC/all.h. More robust
Ryan C. Gordon <icculus@icculus.org>
parents:
155
diff
changeset
|
557 /* An error may have been signalled through the error callback. */ |
77482005beb6
Now includes FLAC/stream_decoder.h instead of FLAC/all.h. More robust
Ryan C. Gordon <icculus@icculus.org>
parents:
155
diff
changeset
|
558 if (sample->flags & SOUND_SAMPLEFLAG_ERROR) |
77482005beb6
Now includes FLAC/stream_decoder.h instead of FLAC/all.h. More robust
Ryan C. Gordon <icculus@icculus.org>
parents:
155
diff
changeset
|
559 return(0); |
231
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
560 |
155 | 561 return(f->frame_size); |
562 } /* FLAC_read */ | |
563 | |
221
c9772a9f5271
Initial implementation or stubs for rewind method. Other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
184
diff
changeset
|
564 |
c9772a9f5271
Initial implementation or stubs for rewind method. Other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
184
diff
changeset
|
565 static int FLAC_rewind(Sound_Sample *sample) |
c9772a9f5271
Initial implementation or stubs for rewind method. Other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
184
diff
changeset
|
566 { |
312 | 567 #if SOUND_SUPPORTS_SEEKABLE_FLAC |
568 return FLAC_seek(sample, 0); | |
569 #else | |
231
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
570 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; |
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
571 flac_t *f = (flac_t *) internal->decoder_private; |
312 | 572 int rc = SDL_RWseek(f->rw, f->data_offset, SEEK_SET); |
231
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
573 |
312 | 574 BAIL_IF_MACRO(rc != f->data_offset, ERR_IO_ERROR, 0); |
575 BAIL_IF_MACRO(!d_reset(f->decoder), "FLAC: could not reset decoder", 0); | |
576 d_process_metadata(f->decoder); | |
231
d3dc34315ac7
Rewind method implemented by Torbj�rn.
Ryan C. Gordon <icculus@icculus.org>
parents:
221
diff
changeset
|
577 return(1); |
312 | 578 #endif |
221
c9772a9f5271
Initial implementation or stubs for rewind method. Other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
184
diff
changeset
|
579 } /* FLAC_rewind */ |
c9772a9f5271
Initial implementation or stubs for rewind method. Other cleanups.
Ryan C. Gordon <icculus@icculus.org>
parents:
184
diff
changeset
|
580 |
306
c97be6e1bd27
Added framework for Sound_Seek() support.
Ryan C. Gordon <icculus@icculus.org>
parents:
231
diff
changeset
|
581 |
c97be6e1bd27
Added framework for Sound_Seek() support.
Ryan C. Gordon <icculus@icculus.org>
parents:
231
diff
changeset
|
582 static int FLAC_seek(Sound_Sample *sample, Uint32 ms) |
c97be6e1bd27
Added framework for Sound_Seek() support.
Ryan C. Gordon <icculus@icculus.org>
parents:
231
diff
changeset
|
583 { |
312 | 584 #if SOUND_SUPPORTS_SEEKABLE_FLAC |
585 Sound_SampleInternal *internal = (Sound_SampleInternal *) sample->opaque; | |
586 flac_t *f = (flac_t *) internal->decoder_private; | |
587 | |
588 d_seek_absolute(f->decoder, (ms * sample->actual.rate) / 1000); | |
589 return(1); | |
590 #else | |
591 BAIL_MACRO("FLAC: This is the non-seekable version of the decoder!", 0); | |
592 #endif | |
306
c97be6e1bd27
Added framework for Sound_Seek() support.
Ryan C. Gordon <icculus@icculus.org>
parents:
231
diff
changeset
|
593 } /* FLAC_seek */ |
c97be6e1bd27
Added framework for Sound_Seek() support.
Ryan C. Gordon <icculus@icculus.org>
parents:
231
diff
changeset
|
594 |
c97be6e1bd27
Added framework for Sound_Seek() support.
Ryan C. Gordon <icculus@icculus.org>
parents:
231
diff
changeset
|
595 |
155 | 596 #endif /* SOUND_SUPPORTS_FLAC */ |
597 | |
598 | |
599 /* end of flac.c ... */ |