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