]>
Commit | Line | Data |
---|---|---|
c6b00c67 | 1 | diff -r -u scummvm-0.9.0/configure scummvm-0.9.0-b2/configure |
2 | --- scummvm-0.9.0/configure 2006-06-21 14:19:07.000000000 -0700 | |
3 | +++ scummvm-0.9.0-b2/configure 2006-10-25 00:10:35.000000000 -0700 | |
4 | @@ -1076,15 +1076,15 @@ | |
5 | if test "$_flac" = auto ; then | |
6 | _flac=no | |
7 | cat > $TMPC << EOF | |
8 | -#include <FLAC/seekable_stream_decoder.h> | |
9 | -int main(void) { FLAC__seekable_stream_decoder_init( 0 ); return 0; } | |
10 | +#include <FLAC/format.h> | |
11 | +int main(void) { return FLAC__STREAM_SYNC_LEN >> 30; /* guaranteed to be 0 */ } | |
12 | EOF | |
13 | - cc_check $LDFLAGS $CXXFLAGS $FLAC_CFLAGS $FLAC_LIBS \ | |
14 | - -lFLAC -lm && _flac=yes | |
15 | + cc_check $LDFLAGS $CXXFLAGS $FLAC_CFLAGS $FLAC_LIBS $OGG_CFLAGS $OGG_LIBS \ | |
16 | + -lFLAC -logg -lm && _flac=yes | |
17 | fi | |
18 | if test "$_flac" = yes ; then | |
19 | _def_flac='#define USE_FLAC' | |
20 | - LIBS="$LIBS $FLAC_LIBS -lFLAC" | |
21 | + LIBS="$LIBS $FLAC_LIBS $OGG_LIBS -lFLAC -logg" | |
22 | INCLUDES="$INCLUDES $FLAC_CFLAGS" | |
23 | else | |
24 | _def_flac='#undef USE_FLAC' | |
25 | diff -r -u scummvm-0.9.0/sound/flac.cpp scummvm-0.9.0-b2/sound/flac.cpp | |
26 | --- scummvm-0.9.0/sound/flac.cpp 2006-06-21 14:16:13.000000000 -0700 | |
27 | +++ scummvm-0.9.0-b2/sound/flac.cpp 2006-10-25 00:08:18.000000000 -0700 | |
28 | @@ -31,7 +31,18 @@ | |
29 | #include "sound/audiocd.h" | |
30 | ||
31 | #define FLAC__NO_DLL // that MS-magic gave me headaches - just link the library you like | |
32 | +#include <FLAC/export.h> | |
33 | +// check if we have FLAC >= 1.1.3; LEGACY_FLAC code can be removed once FLAC-1.1.3 propagates everywhere | |
34 | +#if !defined(FLAC_API_VERSION_CURRENT) || FLAC_API_VERSION_CURRENT < 8 | |
35 | +#define LEGACY_FLAC | |
36 | +#else | |
37 | +#undef LEGACY_FLAC | |
38 | +#endif | |
39 | +#ifdef LEGACY_FLAC | |
40 | #include <FLAC/seekable_stream_decoder.h> | |
41 | +#else | |
42 | +#include <FLAC/stream_decoder.h> | |
43 | +#endif | |
44 | ||
45 | ||
46 | using Common::File; | |
47 | @@ -67,7 +78,11 @@ | |
48 | ||
49 | const FLAC__StreamMetadata_StreamInfo& getStreamInfo() const {return _streaminfo;} | |
50 | ||
51 | +#ifdef LEGACY_FLAC | |
52 | inline FLAC__SeekableStreamDecoderState getState() const; | |
53 | +#else | |
54 | + inline FLAC__StreamDecoderState getState() const; | |
55 | +#endif | |
56 | inline FLAC__StreamDecoderState getStreamDecoderState() const; | |
57 | ||
58 | ||
59 | @@ -81,18 +96,30 @@ | |
60 | inline void setLastSample(FLAC__uint64 absoluteSample); | |
61 | ||
62 | protected: | |
63 | +#ifdef LEGACY_FLAC | |
64 | inline ::FLAC__SeekableStreamDecoderReadStatus callbackRead(FLAC__byte buffer[], uint *bytes); | |
65 | inline ::FLAC__SeekableStreamDecoderSeekStatus callbackSeek(FLAC__uint64 absoluteByteOffset); | |
66 | inline ::FLAC__SeekableStreamDecoderTellStatus callbackTell(FLAC__uint64 *absoluteByteOffset); | |
67 | inline ::FLAC__SeekableStreamDecoderLengthStatus callbackLength(FLAC__uint64 *streamLength); | |
68 | +#else | |
69 | + inline ::FLAC__StreamDecoderReadStatus callbackRead(FLAC__byte buffer[], size_t *bytes); | |
70 | + inline ::FLAC__StreamDecoderSeekStatus callbackSeek(FLAC__uint64 absoluteByteOffset); | |
71 | + inline ::FLAC__StreamDecoderTellStatus callbackTell(FLAC__uint64 *absoluteByteOffset); | |
72 | + inline ::FLAC__StreamDecoderLengthStatus callbackLength(FLAC__uint64 *streamLength); | |
73 | +#endif | |
74 | inline bool callbackEOF(); | |
75 | inline ::FLAC__StreamDecoderWriteStatus callbackWrite(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]); | |
76 | inline void callbackMetadata(const ::FLAC__StreamMetadata *metadata); | |
77 | inline void callbackError(::FLAC__StreamDecoderErrorStatus status); | |
78 | ||
79 | +#ifdef LEGACY_FLAC | |
80 | ::FLAC__SeekableStreamDecoder *_decoder; | |
81 | +#else | |
82 | + ::FLAC__StreamDecoder *_decoder; | |
83 | +#endif | |
84 | ||
85 | private: | |
86 | +#ifdef LEGACY_FLAC | |
87 | static ::FLAC__SeekableStreamDecoderReadStatus callWrapRead(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], uint *bytes, void *clientData); | |
88 | static ::FLAC__SeekableStreamDecoderSeekStatus callWrapSeek(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absoluteByteOffset, void *clientData); | |
89 | static ::FLAC__SeekableStreamDecoderTellStatus callWrapTell(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absoluteByteOffset, void *clientData); | |
90 | @@ -101,6 +128,16 @@ | |
91 | static ::FLAC__StreamDecoderWriteStatus callWrapWrite(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *clientData); | |
92 | static void callWrapMetadata(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *clientData); | |
93 | static void callWrapError(const ::FLAC__SeekableStreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *clientData); | |
94 | +#else | |
95 | + static ::FLAC__StreamDecoderReadStatus callWrapRead(const ::FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *clientData); | |
96 | + static ::FLAC__StreamDecoderSeekStatus callWrapSeek(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 absoluteByteOffset, void *clientData); | |
97 | + static ::FLAC__StreamDecoderTellStatus callWrapTell(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *absoluteByteOffset, void *clientData); | |
98 | + static ::FLAC__StreamDecoderLengthStatus callWrapLength(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *streamLength, void *clientData); | |
99 | + static FLAC__bool callWrapEOF(const ::FLAC__StreamDecoder *decoder, void *clientData); | |
100 | + static ::FLAC__StreamDecoderWriteStatus callWrapWrite(const ::FLAC__StreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *clientData); | |
101 | + static void callWrapMetadata(const ::FLAC__StreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *clientData); | |
102 | + static void callWrapError(const ::FLAC__StreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *clientData); | |
103 | +#endif | |
104 | // Private and undefined so you can't use them: | |
105 | FlacInputStream(const FlacInputStream &); | |
106 | void operator=(const FlacInputStream &); | |
107 | @@ -157,7 +194,12 @@ | |
108 | }; | |
109 | ||
110 | FlacInputStream::FlacInputStream(File *sourceFile, const uint32 fileStart) | |
111 | - : _decoder(::FLAC__seekable_stream_decoder_new()), _firstSample(0), _lastSample(0), | |
112 | +#ifdef LEGACY_FLAC | |
113 | + : _decoder(::FLAC__seekable_stream_decoder_new()), | |
114 | +#else | |
115 | + : _decoder(::FLAC__stream_decoder_new()), | |
116 | +#endif | |
117 | + _firstSample(0), _lastSample(0), | |
118 | _outBuffer(NULL), _requestedSamples(0), _lastSampleWritten(true), | |
119 | _methodConvertBuffers(&FlacInputStream::convertBuffersGeneric) | |
120 | { | |
121 | @@ -178,7 +220,12 @@ | |
122 | } | |
123 | ||
124 | FlacInputStream::FlacInputStream(File *sourceFile, const uint32 fileStart, const uint32 fileStop) | |
125 | - : _decoder(::FLAC__seekable_stream_decoder_new()), _firstSample(0), _lastSample(0), | |
126 | +#ifdef LEGACY_FLAC | |
127 | + : _decoder(::FLAC__seekable_stream_decoder_new()), | |
128 | +#else | |
129 | + : _decoder(::FLAC__stream_decoder_new()), | |
130 | +#endif | |
131 | + _firstSample(0), _lastSample(0), | |
132 | _outBuffer(NULL), _requestedSamples(0), _lastSampleWritten(true), | |
133 | _methodConvertBuffers(&FlacInputStream::convertBuffersGeneric) | |
134 | { | |
135 | @@ -201,8 +248,13 @@ | |
136 | ||
137 | FlacInputStream::~FlacInputStream() { | |
138 | if (_decoder != NULL) { | |
139 | +#ifdef LEGACY_FLAC | |
140 | (void) ::FLAC__seekable_stream_decoder_finish(_decoder); | |
141 | ::FLAC__seekable_stream_decoder_delete(_decoder); | |
142 | +#else | |
143 | + (void) ::FLAC__stream_decoder_finish(_decoder); | |
144 | + ::FLAC__stream_decoder_delete(_decoder); | |
145 | +#endif | |
146 | } | |
147 | if (_preBuffer.bufData != NULL) | |
148 | delete[] _preBuffer.bufData; | |
149 | @@ -210,14 +262,27 @@ | |
150 | _fileInfo.fileHandle->decRef(); | |
151 | } | |
152 | ||
153 | -inline FLAC__SeekableStreamDecoderState FlacInputStream::getState() const { | |
154 | +#ifdef LEGACY_FLAC | |
155 | +inline FLAC__SeekableStreamDecoderState FlacInputStream::getState() const | |
156 | +#else | |
157 | +inline FLAC__StreamDecoderState FlacInputStream::getState() const | |
158 | +#endif | |
159 | +{ | |
160 | assert(isValid()); | |
161 | +#ifdef LEGACY_FLAC | |
162 | return ::FLAC__seekable_stream_decoder_get_state(_decoder); | |
163 | +#else | |
164 | + return ::FLAC__stream_decoder_get_state(_decoder); | |
165 | +#endif | |
166 | } | |
167 | ||
168 | inline FLAC__StreamDecoderState FlacInputStream::getStreamDecoderState() const { | |
169 | assert(isValid()); | |
170 | +#ifdef LEGACY_FLAC | |
171 | return ::FLAC__seekable_stream_decoder_get_stream_decoder_state(_decoder); | |
172 | +#else | |
173 | + return ::FLAC__stream_decoder_get_state(_decoder); | |
174 | +#endif | |
175 | } | |
176 | ||
177 | bool FlacInputStream::init() { | |
178 | @@ -229,6 +294,7 @@ | |
179 | _lastSampleWritten = false; | |
180 | _methodConvertBuffers = &FlacInputStream::convertBuffersGeneric; | |
181 | ||
182 | +#ifdef LEGACY_FLAC | |
183 | ::FLAC__seekable_stream_decoder_set_read_callback(_decoder, &FlacInputStream::callWrapRead); | |
184 | ::FLAC__seekable_stream_decoder_set_seek_callback(_decoder, &FlacInputStream::callWrapSeek); | |
185 | ::FLAC__seekable_stream_decoder_set_tell_callback(_decoder, &FlacInputStream::callWrapTell); | |
186 | @@ -247,6 +313,27 @@ | |
187 | } | |
188 | } | |
189 | } | |
190 | +#else | |
191 | + if (::FLAC__stream_decoder_init_stream( | |
192 | + _decoder, | |
193 | + &FlacInputStream::callWrapRead, | |
194 | + &FlacInputStream::callWrapSeek, | |
195 | + &FlacInputStream::callWrapTell, | |
196 | + &FlacInputStream::callWrapLength, | |
197 | + &FlacInputStream::callWrapEOF, | |
198 | + &FlacInputStream::callWrapWrite, | |
199 | + &FlacInputStream::callWrapMetadata, | |
200 | + &FlacInputStream::callWrapError, | |
201 | + (void*)this | |
202 | + ) == FLAC__STREAM_DECODER_INIT_STATUS_OK) { | |
203 | + if (processUntilEndOfMetadata() && _streaminfo.channels > 0) { | |
204 | + if (_firstSample == 0 || 0 != ::FLAC__stream_decoder_seek_absolute(_decoder, _firstSample)) { | |
205 | + // FLAC__StreamDecoderState state = getStreamDecoderState(); | |
206 | + return true; // no error occured | |
207 | + } | |
208 | + } | |
209 | + } | |
210 | +#endif | |
211 | ||
212 | warning("FlacInputStream: could not create an Audiostream from File %s", _fileInfo.fileHandle->name()); | |
213 | return false; | |
214 | @@ -255,28 +342,48 @@ | |
215 | bool FlacInputStream::finish() { | |
216 | assert(isValid()); | |
217 | deleteBuffer(); | |
218 | +#ifdef LEGACY_FLAC | |
219 | return 0 != ::FLAC__seekable_stream_decoder_finish(_decoder); | |
220 | +#else | |
221 | + return 0 != ::FLAC__stream_decoder_finish(_decoder); | |
222 | +#endif | |
223 | } | |
224 | ||
225 | bool FlacInputStream::flush() { | |
226 | assert(isValid()); | |
227 | flushBuffer(); | |
228 | +#ifdef LEGACY_FLAC | |
229 | return 0 != ::FLAC__seekable_stream_decoder_flush(_decoder); | |
230 | +#else | |
231 | + return 0 != ::FLAC__stream_decoder_flush(_decoder); | |
232 | +#endif | |
233 | } | |
234 | ||
235 | inline bool FlacInputStream::processSingleBlock() { | |
236 | assert(isValid()); | |
237 | +#ifdef LEGACY_FLAC | |
238 | return 0 != ::FLAC__seekable_stream_decoder_process_single(_decoder); | |
239 | +#else | |
240 | + return 0 != ::FLAC__stream_decoder_process_single(_decoder); | |
241 | +#endif | |
242 | } | |
243 | ||
244 | inline bool FlacInputStream::processUntilEndOfMetadata() { | |
245 | assert(isValid()); | |
246 | +#ifdef LEGACY_FLAC | |
247 | return 0 != ::FLAC__seekable_stream_decoder_process_until_end_of_metadata(_decoder); | |
248 | +#else | |
249 | + return 0 != ::FLAC__stream_decoder_process_until_end_of_metadata(_decoder); | |
250 | +#endif | |
251 | } | |
252 | ||
253 | bool FlacInputStream::seekAbsolute(FLAC__uint64 sample) { | |
254 | assert(isValid()); | |
255 | +#ifdef LEGACY_FLAC | |
256 | const bool result = (0 != ::FLAC__seekable_stream_decoder_seek_absolute(_decoder, sample)); | |
257 | +#else | |
258 | + const bool result = (0 != ::FLAC__stream_decoder_seek_absolute(_decoder, sample)); | |
259 | +#endif | |
260 | if (result) { | |
261 | flushBuffer(); | |
262 | _lastSampleWritten = (_lastSample != 0 && sample >= _lastSample); // only set if we are SURE | |
263 | @@ -349,11 +456,20 @@ | |
264 | return decoderOk ? samples : -1; | |
265 | } | |
266 | ||
267 | -inline ::FLAC__SeekableStreamDecoderReadStatus FlacInputStream::callbackRead(FLAC__byte buffer[], uint *bytes) { | |
268 | +#ifdef LEGACY_FLAC | |
269 | +inline ::FLAC__SeekableStreamDecoderReadStatus FlacInputStream::callbackRead(FLAC__byte buffer[], uint *bytes) | |
270 | +#else | |
271 | +inline ::FLAC__StreamDecoderReadStatus FlacInputStream::callbackRead(FLAC__byte buffer[], size_t *bytes) | |
272 | +#endif | |
273 | +{ | |
274 | assert(_fileInfo.fileHandle != NULL); | |
275 | ||
276 | if (*bytes == 0) | |
277 | +#ifdef LEGACY_FLAC | |
278 | return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR; /* abort to avoid a deadlock */ | |
279 | +#else | |
280 | + return FLAC__STREAM_DECODER_READ_STATUS_ABORT; /* abort to avoid a deadlock */ | |
281 | +#endif | |
282 | ||
283 | const uint32 length = MIN(_fileInfo.fileEndPos - _fileInfo.filePos, static_cast<uint32>(*bytes)); | |
284 | ||
285 | @@ -361,11 +477,19 @@ | |
286 | const uint32 bytesRead = _fileInfo.fileHandle->read(buffer, length); | |
287 | ||
288 | if (bytesRead == 0 && _fileInfo.fileHandle->ioFailed()) | |
289 | +#ifdef LEGACY_FLAC | |
290 | return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR; | |
291 | +#else | |
292 | + return FLAC__STREAM_DECODER_READ_STATUS_ABORT; | |
293 | +#endif | |
294 | ||
295 | _fileInfo.filePos += bytesRead; | |
296 | *bytes = static_cast<uint>(bytesRead); | |
297 | +#ifdef LEGACY_FLAC | |
298 | return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK; | |
299 | +#else | |
300 | + return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; | |
301 | +#endif | |
302 | } | |
303 | ||
304 | inline void FlacInputStream::setLastSample(FLAC__uint64 absoluteSample) { | |
305 | @@ -637,30 +761,60 @@ | |
306 | return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; | |
307 | } | |
308 | ||
309 | -inline ::FLAC__SeekableStreamDecoderSeekStatus FlacInputStream::callbackSeek(FLAC__uint64 absoluteByteOffset) { | |
310 | +#ifdef LEGACY_FLAC | |
311 | +inline ::FLAC__SeekableStreamDecoderSeekStatus FlacInputStream::callbackSeek(FLAC__uint64 absoluteByteOffset) | |
312 | +#else | |
313 | +inline ::FLAC__StreamDecoderSeekStatus FlacInputStream::callbackSeek(FLAC__uint64 absoluteByteOffset) | |
314 | +#endif | |
315 | +{ | |
316 | FLAC__uint64 newPos = absoluteByteOffset + _fileInfo.fileStartPos; | |
317 | const bool result = (newPos < _fileInfo.fileEndPos); | |
318 | ||
319 | if (result) | |
320 | _fileInfo.filePos = static_cast<uint32>(newPos); | |
321 | ||
322 | +#ifdef LEGACY_FLAC | |
323 | return result ? FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK : FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR; | |
324 | - | |
325 | +#else | |
326 | + return result ? FLAC__STREAM_DECODER_SEEK_STATUS_OK : FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; | |
327 | +#endif | |
328 | } | |
329 | ||
330 | -inline ::FLAC__SeekableStreamDecoderTellStatus FlacInputStream::callbackTell(FLAC__uint64 *absoluteByteOffset) { | |
331 | +#ifdef LEGACY_FLAC | |
332 | +inline ::FLAC__SeekableStreamDecoderTellStatus FlacInputStream::callbackTell(FLAC__uint64 *absoluteByteOffset) | |
333 | +#else | |
334 | +inline ::FLAC__StreamDecoderTellStatus FlacInputStream::callbackTell(FLAC__uint64 *absoluteByteOffset) | |
335 | +#endif | |
336 | +{ | |
337 | /*if () | |
338 | return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR;*/ | |
339 | *absoluteByteOffset = static_cast<FLAC__uint64>(_fileInfo.filePos-_fileInfo.fileStartPos); | |
340 | +#ifdef LEGACY_FLAC | |
341 | return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK; | |
342 | +#else | |
343 | + return FLAC__STREAM_DECODER_TELL_STATUS_OK; | |
344 | +#endif | |
345 | } | |
346 | ||
347 | -inline ::FLAC__SeekableStreamDecoderLengthStatus FlacInputStream::callbackLength(FLAC__uint64 *streamLength) { | |
348 | +#ifdef LEGACY_FLAC | |
349 | +inline ::FLAC__SeekableStreamDecoderLengthStatus FlacInputStream::callbackLength(FLAC__uint64 *streamLength) | |
350 | +#else | |
351 | +inline ::FLAC__StreamDecoderLengthStatus FlacInputStream::callbackLength(FLAC__uint64 *streamLength) | |
352 | +#endif | |
353 | +{ | |
354 | if (_fileInfo.fileStartPos > _fileInfo.fileEndPos) | |
355 | +#ifdef LEGACY_FLAC | |
356 | return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR; | |
357 | +#else | |
358 | + return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; | |
359 | +#endif | |
360 | ||
361 | *streamLength = static_cast<FLAC__uint64>(_fileInfo.fileEndPos - _fileInfo.fileStartPos); | |
362 | +#ifdef LEGACY_FLAC | |
363 | return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK; | |
364 | +#else | |
365 | + return FLAC__STREAM_DECODER_LENGTH_STATUS_OK; | |
366 | +#endif | |
367 | } | |
368 | ||
369 | inline bool FlacInputStream::callbackEOF() { | |
370 | @@ -682,56 +836,96 @@ | |
371 | } | |
372 | ||
373 | /* Static Callback Wrappers */ | |
374 | -::FLAC__SeekableStreamDecoderReadStatus FlacInputStream::callWrapRead(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], uint *bytes, void *clientData) { | |
375 | +#ifdef LEGACY_FLAC | |
376 | +::FLAC__SeekableStreamDecoderReadStatus FlacInputStream::callWrapRead(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], uint *bytes, void *clientData) | |
377 | +#else | |
378 | +::FLAC__StreamDecoderReadStatus FlacInputStream::callWrapRead(const ::FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *clientData) | |
379 | +#endif | |
380 | +{ | |
381 | assert(0 != clientData); | |
382 | FlacInputStream *instance = reinterpret_cast<FlacInputStream *>(clientData); | |
383 | assert(0 != instance); | |
384 | return instance->callbackRead(buffer, bytes); | |
385 | } | |
386 | ||
387 | -::FLAC__SeekableStreamDecoderSeekStatus FlacInputStream::callWrapSeek(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absoluteByteOffset, void *clientData) { | |
388 | +#ifdef LEGACY_FLAC | |
389 | +::FLAC__SeekableStreamDecoderSeekStatus FlacInputStream::callWrapSeek(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absoluteByteOffset, void *clientData) | |
390 | +#else | |
391 | +::FLAC__StreamDecoderSeekStatus FlacInputStream::callWrapSeek(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 absoluteByteOffset, void *clientData) | |
392 | +#endif | |
393 | +{ | |
394 | assert(0 != clientData); | |
395 | FlacInputStream *instance = reinterpret_cast<FlacInputStream *>(clientData); | |
396 | assert(0 != instance); | |
397 | return instance->callbackSeek(absoluteByteOffset); | |
398 | } | |
399 | ||
400 | -::FLAC__SeekableStreamDecoderTellStatus FlacInputStream::callWrapTell(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absoluteByteOffset, void *clientData) { | |
401 | +#ifdef LEGACY_FLAC | |
402 | +::FLAC__SeekableStreamDecoderTellStatus FlacInputStream::callWrapTell(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absoluteByteOffset, void *clientData) | |
403 | +#else | |
404 | +::FLAC__StreamDecoderTellStatus FlacInputStream::callWrapTell(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *absoluteByteOffset, void *clientData) | |
405 | +#endif | |
406 | +{ | |
407 | assert(0 != clientData); | |
408 | FlacInputStream *instance = reinterpret_cast<FlacInputStream *>(clientData); | |
409 | assert(0 != instance); | |
410 | return instance->callbackTell(absoluteByteOffset); | |
411 | } | |
412 | ||
413 | -::FLAC__SeekableStreamDecoderLengthStatus FlacInputStream::callWrapLength(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *streamLength, void *clientData) { | |
414 | +#ifdef LEGACY_FLAC | |
415 | +::FLAC__SeekableStreamDecoderLengthStatus FlacInputStream::callWrapLength(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *streamLength, void *clientData) | |
416 | +#else | |
417 | +::FLAC__StreamDecoderLengthStatus FlacInputStream::callWrapLength(const ::FLAC__StreamDecoder *decoder, FLAC__uint64 *streamLength, void *clientData) | |
418 | +#endif | |
419 | +{ | |
420 | assert(0 != clientData); | |
421 | FlacInputStream *instance = reinterpret_cast<FlacInputStream *>(clientData); | |
422 | assert(0 != instance); | |
423 | return instance->callbackLength(streamLength); | |
424 | } | |
425 | ||
426 | -FLAC__bool FlacInputStream::callWrapEOF(const ::FLAC__SeekableStreamDecoder *decoder, void *clientData) { | |
427 | +#ifdef LEGACY_FLAC | |
428 | +FLAC__bool FlacInputStream::callWrapEOF(const ::FLAC__SeekableStreamDecoder *decoder, void *clientData) | |
429 | +#else | |
430 | +FLAC__bool FlacInputStream::callWrapEOF(const ::FLAC__StreamDecoder *decoder, void *clientData) | |
431 | +#endif | |
432 | +{ | |
433 | assert(0 != clientData); | |
434 | FlacInputStream *instance = reinterpret_cast<FlacInputStream *>(clientData); | |
435 | assert(0 != instance); | |
436 | return instance->callbackEOF(); | |
437 | } | |
438 | ||
439 | -::FLAC__StreamDecoderWriteStatus FlacInputStream::callWrapWrite(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *clientData) { | |
440 | +#ifdef LEGACY_FLAC | |
441 | +::FLAC__StreamDecoderWriteStatus FlacInputStream::callWrapWrite(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *clientData) | |
442 | +#else | |
443 | +::FLAC__StreamDecoderWriteStatus FlacInputStream::callWrapWrite(const ::FLAC__StreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *clientData) | |
444 | +#endif | |
445 | +{ | |
446 | assert(0 != clientData); | |
447 | FlacInputStream *instance = reinterpret_cast<FlacInputStream *>(clientData); | |
448 | assert(0 != instance); | |
449 | return instance->callbackWrite(frame, buffer); | |
450 | } | |
451 | ||
452 | -void FlacInputStream::callWrapMetadata(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *clientData) { | |
453 | +#ifdef LEGACY_FLAC | |
454 | +void FlacInputStream::callWrapMetadata(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *clientData) | |
455 | +#else | |
456 | +void FlacInputStream::callWrapMetadata(const ::FLAC__StreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *clientData) | |
457 | +#endif | |
458 | +{ | |
459 | assert(0 != clientData); | |
460 | FlacInputStream *instance = reinterpret_cast<FlacInputStream *>(clientData); | |
461 | assert(0 != instance); | |
462 | instance->callbackMetadata(metadata); | |
463 | } | |
464 | ||
465 | -void FlacInputStream::callWrapError(const ::FLAC__SeekableStreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *clientData) { | |
466 | +#ifdef LEGACY_FLAC | |
467 | +void FlacInputStream::callWrapError(const ::FLAC__SeekableStreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *clientData) | |
468 | +#else | |
469 | +void FlacInputStream::callWrapError(const ::FLAC__StreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *clientData) | |
470 | +#endif | |
471 | +{ | |
472 | assert(0 != clientData); | |
473 | FlacInputStream *instance = reinterpret_cast<FlacInputStream *>(clientData); | |
474 | assert(0 != instance); |