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