]> git.pld-linux.org Git - packages/alsaplayer.git/blame - alsaplayer-flac.patch
- fix for 64 bit systems
[packages/alsaplayer.git] / alsaplayer-flac.patch
CommitLineData
34340c54 1diff -ur alsaplayer-0.99.77.orig/input/flac/FlacSeekableStream.cpp alsaplayer-0.99.77/input/flac/FlacSeekableStream.cpp
2--- alsaplayer-0.99.77.orig/input/flac/FlacSeekableStream.cpp 2003-03-03 09:32:59.000000000 +0100
3+++ alsaplayer-0.99.77/input/flac/FlacSeekableStream.cpp 2007-04-01 15:46:30.000000000 +0200
677de6d2
SS
4@@ -39,8 +39,8 @@
5 {
6 if (_decoder)
7 {
8- FLAC__seekable_stream_decoder_finish (_decoder);
9- FLAC__seekable_stream_decoder_delete (_decoder);
10+ FLAC__stream_decoder_finish (_decoder);
11+ FLAC__stream_decoder_delete (_decoder);
12 _decoder = 0;
13 }
14
15@@ -56,43 +56,36 @@
16 return false;
17 }
18
19- _decoder = FLAC__seekable_stream_decoder_new ();
20+ _decoder = FLAC__stream_decoder_new ();
21 if (!_decoder) {
22- apError ("FlacSeekableStream::open(): error creating FLAC__seekable_stream_decoder");
23+ apError ("FlacSeekableStream::open(): error creating FLAC__stream_decoder");
24 return false;
25 }
26 bool status = true;
27- status &= FLAC__seekable_stream_decoder_set_read_callback (_decoder,
28- readCallBack);
29- status &= FLAC__seekable_stream_decoder_set_write_callback (_decoder,
30- writeCallBack);
31- status &= FLAC__seekable_stream_decoder_set_metadata_callback (_decoder,
32- metaCallBack);
33- status &= FLAC__seekable_stream_decoder_set_error_callback (_decoder,
34- errCallBack);
35- status &= FLAC__seekable_stream_decoder_set_seek_callback (_decoder,
36- seekCallBack);
37- status &= FLAC__seekable_stream_decoder_set_tell_callback (_decoder,
38- tellCallBack);
39- status &= FLAC__seekable_stream_decoder_set_length_callback (_decoder,
40- lengthCallBack);
41- status &= FLAC__seekable_stream_decoder_set_eof_callback (_decoder,
42- eofCallBack);
43- status &= FLAC__seekable_stream_decoder_set_client_data (_decoder, (void *) this);
44
45 if (!status) {
46 apError ("FlacSeekableStream::open(): status error, huh?");
47 return false;
48 }
49- status = (FLAC__seekable_stream_decoder_init (_decoder) == FLAC__SEEKABLE_STREAM_DECODER_OK);
50+ status = (FLAC__stream_decoder_init_stream (_decoder,
51+ readCallBack,
52+ seekCallBack,
53+ tellCallBack,
54+ lengthCallBack,
55+ eofCallBack,
56+ writeCallBack,
57+ metaCallBack,
58+ errCallBack,
59+ (void*) this)
60+ == FLAC__STREAM_DECODER_INIT_STATUS_OK);
61
62 if (!status) {
63- apError ("FlacSeekableStream::open(): can't initialize seekable stream decoder");
64+ apError ("FlacSeekableStream::open(): can't initialize stream decoder");
65 return false;
66 }
67
68 // this will invoke the metaCallBack
69- if (!FLAC__seekable_stream_decoder_process_until_end_of_metadata (_decoder)) {
70+ if (!FLAC__stream_decoder_process_until_end_of_metadata (_decoder)) {
71 apError ("FlacSeekableStream::open(): decoder error");
72 return false;
73 }
74@@ -117,7 +110,7 @@
75 if (!_decoder)
76 return false;
77
78- return FLAC__seekable_stream_decoder_process_single (_decoder);
79+ return FLAC__stream_decoder_process_single (_decoder);
80
81 } // FlacSeekableStream::processOneFrame
82
83@@ -128,14 +121,14 @@
84 if (!_decoder)
85 return false;
86
87- return FLAC__seekable_stream_decoder_seek_absolute (_decoder, sample);
88+ return FLAC__stream_decoder_seek_absolute (_decoder, sample);
89
90 } // FlacSeekableStream::seekAbsolute
91
92
93 // static
94 void
95-FlacSeekableStream::metaCallBack (const FLAC__SeekableStreamDecoder * decoder,
96+FlacSeekableStream::metaCallBack (const FLAC__StreamDecoder * decoder,
97 const FLAC__StreamMetadata * md,
98 void * client_data)
99 {
100@@ -154,7 +147,7 @@
101
102 // static
103 void
104-FlacSeekableStream::errCallBack (const FLAC__SeekableStreamDecoder * decoder,
105+FlacSeekableStream::errCallBack (const FLAC__StreamDecoder * decoder,
106 FLAC__StreamDecoderErrorStatus status,
107 void * client_data)
108 {
109@@ -172,7 +165,7 @@
110
111 // static
112 FLAC__StreamDecoderWriteStatus
113-FlacSeekableStream::writeCallBack (const FLAC__SeekableStreamDecoder * /*decoder*/,
114+FlacSeekableStream::writeCallBack (const FLAC__StreamDecoder * /*decoder*/,
115 const FLAC__Frame * frame,
116 const FLAC__int32 * const buffer[],
117 void * client_data)
118@@ -190,91 +183,91 @@
119
120
121 // static
122-FLAC__SeekableStreamDecoderReadStatus
123-FlacSeekableStream::readCallBack (const FLAC__SeekableStreamDecoder * /*decoder*/,
124+FLAC__StreamDecoderReadStatus
125+FlacSeekableStream::readCallBack (const FLAC__StreamDecoder * /*decoder*/,
126 FLAC__byte buffer[],
34340c54 127- unsigned * bytes,
128+ size_t * bytes,
677de6d2
SS
129 void * client_data)
130 {
131 if (!client_data)
132- return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
133+ return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
134 FlacSeekableStream * f = (FlacSeekableStream *) client_data;
135 if (!f)
136- return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
137+ return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
138
139 *bytes = reader_read (buffer, *bytes, f->_datasource);
140- return *bytes > 0 ? FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK :
141+ return *bytes > 0 ? FLAC__STREAM_DECODER_READ_STATUS_CONTINUE :
142 reader_eof (f->_datasource) ?
143- FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK :
144- FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
145+ FLAC__STREAM_DECODER_READ_STATUS_CONTINUE :
146+ FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
147
148 } // FlacSeekableStream::readCallBack
149
150
151 // static
152-FLAC__SeekableStreamDecoderSeekStatus
153-FlacSeekableStream::seekCallBack (const FLAC__SeekableStreamDecoder * /*decoder*/,
154+FLAC__StreamDecoderSeekStatus
155+FlacSeekableStream::seekCallBack (const FLAC__StreamDecoder * /*decoder*/,
156 FLAC__uint64 offset,
157 void * client_data)
158 {
159 if (!client_data)
160- return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
161+ return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
162 FlacSeekableStream * f = (FlacSeekableStream *) client_data;
163 if (!f)
164- return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
165+ return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
166
167 return reader_seek (f->_datasource, offset, SEEK_SET) == 0 ?
168- FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK :
169- FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
170+ FLAC__STREAM_DECODER_SEEK_STATUS_OK :
171+ FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
172
173 } // FlacSeekableStream::seekCallBack
174
175
176 // static
177-FLAC__SeekableStreamDecoderTellStatus
178-FlacSeekableStream::tellCallBack (const FLAC__SeekableStreamDecoder * /*decoder*/,
179+FLAC__StreamDecoderTellStatus
180+FlacSeekableStream::tellCallBack (const FLAC__StreamDecoder * /*decoder*/,
181 FLAC__uint64 * offset,
182 void * client_data)
183 {
184 if (!client_data)
185- return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR;
186+ return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
187 FlacSeekableStream * f = (FlacSeekableStream *) client_data;
188 if (!f)
189- return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR;
190+ return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
191
192 long result = reader_tell (f->_datasource);
193 if (result == -1)
194- return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR;
195+ return FLAC__STREAM_DECODER_TELL_STATUS_ERROR;
196 *offset = result;
197- return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
198+ return FLAC__STREAM_DECODER_TELL_STATUS_OK;
199
200 } // FlacSeekableStream::tellCallBack
201
202
203 // static
204-FLAC__SeekableStreamDecoderLengthStatus
205-FlacSeekableStream::lengthCallBack (const FLAC__SeekableStreamDecoder * /*decoder*/,
206+FLAC__StreamDecoderLengthStatus
207+FlacSeekableStream::lengthCallBack (const FLAC__StreamDecoder * /*decoder*/,
208 FLAC__uint64 * len,
209 void * client_data)
210 {
211 if (!client_data)
212- return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR;
213+ return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
214 FlacSeekableStream * f = (FlacSeekableStream *) client_data;
215 if (!f)
216- return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR;
217+ return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
218
219 long result = reader_length (f->_datasource);
220 if (result == -1)
221- return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR;
222+ return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR;
223 *len = result;
224- return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
225+ return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
226
227 } // FlacSeekableStream::lengthCallBack
228
229
230 // static
231 FLAC__bool
232-FlacSeekableStream::eofCallBack (const FLAC__SeekableStreamDecoder * /*decoder*/,
233+FlacSeekableStream::eofCallBack (const FLAC__StreamDecoder * /*decoder*/,
234 void * client_data)
235 {
236 if (!client_data)
34340c54 237diff -ur alsaplayer-0.99.77.orig/input/flac/FlacSeekableStream.h alsaplayer-0.99.77/input/flac/FlacSeekableStream.h
238--- alsaplayer-0.99.77.orig/input/flac/FlacSeekableStream.h 2003-03-03 09:32:59.000000000 +0100
239+++ alsaplayer-0.99.77/input/flac/FlacSeekableStream.h 2007-04-01 15:45:53.000000000 +0200
677de6d2
SS
240@@ -28,7 +28,7 @@
241
242 extern "C"
243 {
244-#include <FLAC/seekable_stream_decoder.h>
245+#include <FLAC/stream_decoder.h>
246 }
247
248 namespace Flac
249@@ -78,42 +78,42 @@
250 // flac callbacks for a seekable stream.
251 //---------------------------------------
252
253- static void metaCallBack (const FLAC__SeekableStreamDecoder * decoder,
254+ static void metaCallBack (const FLAC__StreamDecoder * decoder,
255 const FLAC__StreamMetadata * md,
256 void * client_data);
257
258 static FLAC__StreamDecoderWriteStatus
259- writeCallBack (const FLAC__SeekableStreamDecoder * decoder,
260+ writeCallBack (const FLAC__StreamDecoder * decoder,
261 const FLAC__Frame * frame,
262 const FLAC__int32 * const buffer[],
263 void * client_data);
264
265- static FLAC__SeekableStreamDecoderReadStatus
266- readCallBack (const FLAC__SeekableStreamDecoder * decoder,
267+ static FLAC__StreamDecoderReadStatus
268+ readCallBack (const FLAC__StreamDecoder * decoder,
269 FLAC__byte buffer[],
34340c54 270- unsigned * bytes,
271+ size_t * bytes,
677de6d2
SS
272 void * client_data);
273
274- static void errCallBack (const FLAC__SeekableStreamDecoder * decoder,
275+ static void errCallBack (const FLAC__StreamDecoder * decoder,
276 FLAC__StreamDecoderErrorStatus status,
277 void * client_data);
278
279- static FLAC__SeekableStreamDecoderSeekStatus
280- seekCallBack (const FLAC__SeekableStreamDecoder * decoder,
281+ static FLAC__StreamDecoderSeekStatus
282+ seekCallBack (const FLAC__StreamDecoder * decoder,
283 FLAC__uint64 offset,
284 void * client_data);
285
286- static FLAC__SeekableStreamDecoderTellStatus
287- tellCallBack (const FLAC__SeekableStreamDecoder * decoder,
288+ static FLAC__StreamDecoderTellStatus
289+ tellCallBack (const FLAC__StreamDecoder * decoder,
290 FLAC__uint64 * offset,
291 void * client_data);
292
293- static FLAC__SeekableStreamDecoderLengthStatus
294- lengthCallBack (const FLAC__SeekableStreamDecoder * decoder,
295+ static FLAC__StreamDecoderLengthStatus
296+ lengthCallBack (const FLAC__StreamDecoder * decoder,
297 FLAC__uint64 * len,
298 void * client_data);
299
300- static FLAC__bool eofCallBack (const FLAC__SeekableStreamDecoder * decoder,
301+ static FLAC__bool eofCallBack (const FLAC__StreamDecoder * decoder,
302 void * client_data);
303
304
305@@ -124,7 +124,7 @@
306
307 private:
308
309- FLAC__SeekableStreamDecoder * _decoder;
310+ FLAC__StreamDecoder * _decoder;
311
312 }; // class FlacSeekableStream
313
34340c54 314diff -ur alsaplayer-0.99.77.orig/input/flac/FlacStream.cpp alsaplayer-0.99.77/input/flac/FlacStream.cpp
315--- alsaplayer-0.99.77.orig/input/flac/FlacStream.cpp 2003-03-09 03:46:33.000000000 +0100
316+++ alsaplayer-0.99.77/input/flac/FlacStream.cpp 2007-04-01 15:45:45.000000000 +0200
317@@ -116,21 +116,22 @@
318 return false;
319 }
320 bool status = true;
321- status &= FLAC__stream_decoder_set_read_callback (_decoder,
322- readCallBack);
323- status &= FLAC__stream_decoder_set_write_callback (_decoder,
324- writeCallBack);
325- status &= FLAC__stream_decoder_set_metadata_callback (_decoder,
326- metaCallBack);
327- status &= FLAC__stream_decoder_set_error_callback (_decoder,
328- errCallBack);
329- status &= FLAC__stream_decoder_set_client_data (_decoder, (void *) this);
330
331 if (!status) {
332 apError("FlacStream::open(): status error, huh?");
333 return false;
334 }
335- status = (FLAC__stream_decoder_init (_decoder) == FLAC__STREAM_DECODER_SEARCH_FOR_METADATA);
336+ status = (FLAC__stream_decoder_init_stream ( _decoder,
337+ readCallBack,
338+ NULL,
339+ NULL,
340+ NULL,
341+ NULL,
342+ writeCallBack,
343+ metaCallBack,
344+ errCallBack,
345+ (void *) this)
346+ == FLAC__STREAM_DECODER_INIT_STATUS_OK);
347
348 if (!status) {
349 apError("FlacStream::open(): can't initialize stream decoder");
350@@ -300,7 +301,7 @@
351
352
353 FLAC__StreamDecoderReadStatus
354-FlacStream::realReadCallBack (FLAC__byte buffer[], unsigned * bytes)
355+FlacStream::realReadCallBack (FLAC__byte buffer[], size_t * bytes)
356 {
357 *bytes = reader_read (buffer, *bytes, _datasource);
358 return *bytes > 0 ? FLAC__STREAM_DECODER_READ_STATUS_CONTINUE :
359@@ -315,7 +316,7 @@
360 FLAC__StreamDecoderReadStatus
361 FlacStream::readCallBack (const FLAC__StreamDecoder *,
362 FLAC__byte buffer[],
363- unsigned * bytes,
364+ size_t * bytes,
365 void * client_data)
366 {
367 if (!client_data)
368diff -ur alsaplayer-0.99.77.orig/input/flac/FlacStream.h alsaplayer-0.99.77/input/flac/FlacStream.h
369--- alsaplayer-0.99.77.orig/input/flac/FlacStream.h 2003-03-03 09:32:59.000000000 +0100
370+++ alsaplayer-0.99.77/input/flac/FlacStream.h 2007-04-01 15:46:08.000000000 +0200
371@@ -191,7 +191,7 @@
372
373 FLAC__StreamDecoderReadStatus
374 realReadCallBack (FLAC__byte buffer[],
375- unsigned * bytes);
376+ size_t * bytes);
377
378
379 protected:
380@@ -233,7 +233,7 @@
381 static FLAC__StreamDecoderReadStatus
382 readCallBack (const FLAC__StreamDecoder * decoder,
383 FLAC__byte buffer[],
384- unsigned * bytes,
385+ size_t * bytes,
386 void * client_data);
387
388 static void errCallBack (const FLAC__StreamDecoder * decoder,
389diff -ur alsaplayer-0.99.77.orig/input/flac/OggFlacStream.cpp alsaplayer-0.99.77/input/flac/OggFlacStream.cpp
390--- alsaplayer-0.99.77.orig/input/flac/OggFlacStream.cpp 2003-03-09 03:46:34.000000000 +0100
391+++ alsaplayer-0.99.77/input/flac/OggFlacStream.cpp 2007-04-01 15:46:39.000000000 +0200
392@@ -186,7 +186,7 @@
393 FLAC__StreamDecoderReadStatus
394 OggFlacStream::readCallBack (const OggFLAC__StreamDecoder * decoder,
395 FLAC__byte buffer[],
396- unsigned * bytes,
397+ size_t * bytes,
398 void * client_data)
399 {
400 if (!client_data)
401diff -ur alsaplayer-0.99.77.orig/input/flac/OggFlacStream.h alsaplayer-0.99.77/input/flac/OggFlacStream.h
402--- alsaplayer-0.99.77.orig/input/flac/OggFlacStream.h 2003-03-03 09:33:47.000000000 +0100
403+++ alsaplayer-0.99.77/input/flac/OggFlacStream.h 2007-04-01 15:46:18.000000000 +0200
404@@ -105,7 +105,7 @@
405 static FLAC__StreamDecoderReadStatus
406 readCallBack (const OggFLAC__StreamDecoder * decoder,
407 FLAC__byte buffer[],
408- unsigned * bytes,
409+ size_t * bytes,
410 void * client_data);
411
412 static void errCallBack (const OggFLAC__StreamDecoder * decoder,
This page took 1.052453 seconds and 4 git commands to generate.