]>
Commit | Line | Data |
---|---|---|
05eeb316 JB |
1 | --- libsndfile-1.0.17/src/flac.c.orig 2006-08-31 11:22:19.000000000 +0200 |
2 | +++ libsndfile-1.0.17/src/flac.c 2006-12-24 18:01:46.197783626 +0100 | |
3 | @@ -60,8 +60,8 @@ | |
4 | } PFLAC_PCM ; | |
5 | ||
6 | typedef struct | |
7 | -{ FLAC__SeekableStreamDecoder *fsd ; | |
8 | - FLAC__SeekableStreamEncoder *fse ; | |
9 | +{ FLAC__StreamDecoder *fsd ; | |
10 | + FLAC__StreamEncoder *fse ; | |
11 | PFLAC_PCM pcmtype ; | |
12 | void* ptr ; | |
13 | unsigned pos, len, remain ; | |
14 | @@ -108,21 +108,19 @@ | |
15 | static int flac_command (SF_PRIVATE *psf, int command, void *data, int datasize) ; | |
16 | ||
17 | /* Decoder Callbacks */ | |
18 | -static FLAC__SeekableStreamDecoderReadStatus sf_flac_read_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer [], unsigned *bytes, void *client_data) ; | |
19 | -static FLAC__SeekableStreamDecoderSeekStatus sf_flac_seek_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) ; | |
20 | -static FLAC__SeekableStreamDecoderTellStatus sf_flac_tell_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ; | |
21 | -static FLAC__SeekableStreamDecoderLengthStatus sf_flac_length_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) ; | |
22 | -static FLAC__bool sf_flac_eof_callback (const FLAC__SeekableStreamDecoder *decoder, void *client_data) ; | |
23 | -static FLAC__StreamDecoderWriteStatus sf_flac_write_callback (const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) ; | |
24 | -static void sf_flac_meta_callback (const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) ; | |
25 | -static void sf_flac_error_callback (const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) ; | |
26 | +static FLAC__StreamDecoderReadStatus sf_flac_read_callback (const FLAC__StreamDecoder *decoder, FLAC__byte buffer [], unsigned *bytes, void *client_data) ; | |
27 | +static FLAC__StreamDecoderSeekStatus sf_flac_seek_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) ; | |
28 | +static FLAC__StreamDecoderTellStatus sf_flac_tell_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ; | |
29 | +static FLAC__StreamDecoderLengthStatus sf_flac_length_callback (const FLAC__StreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data) ; | |
30 | +static FLAC__bool sf_flac_eof_callback (const FLAC__StreamDecoder *decoder, void *client_data) ; | |
31 | +static FLAC__StreamDecoderWriteStatus sf_flac_write_callback (const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) ; | |
32 | +static void sf_flac_meta_callback (const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data) ; | |
33 | +static void sf_flac_error_callback (const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data) ; | |
34 | ||
35 | /* Encoder Callbacks */ | |
36 | -static FLAC__SeekableStreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) ; | |
37 | -#ifdef HAVE_FLAC_1_1_1 | |
38 | -static FLAC__SeekableStreamEncoderTellStatus sf_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ; | |
39 | -#endif | |
40 | -static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const FLAC__SeekableStreamEncoder *encoder, const FLAC__byte buffer [], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data) ; | |
41 | +static FLAC__StreamEncoderSeekStatus sf_flac_enc_seek_callback (const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data) ; | |
42 | +static FLAC__StreamEncoderTellStatus sf_flac_enc_tell_callback (const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data) ; | |
43 | +static FLAC__StreamEncoderWriteStatus sf_flac_enc_write_callback (const FLAC__StreamEncoder *encoder, const FLAC__byte buffer [], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data) ; | |
44 | ||
45 | static const int legal_sample_rates [] = | |
46 | { 8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000 | |
47 | @@ -283,51 +281,51 @@ | |
48 | } /* flac_buffer_copy */ | |
49 | ||
50 | ||
51 | -static FLAC__SeekableStreamDecoderReadStatus | |
52 | -sf_flac_read_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__byte buffer [], unsigned *bytes, void *client_data) | |
53 | +static FLAC__StreamDecoderReadStatus | |
54 | +sf_flac_read_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__byte buffer [], unsigned *bytes, void *client_data) | |
55 | { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; | |
56 | ||
57 | *bytes = psf_fread (buffer, 1, *bytes, psf) ; | |
58 | if (*bytes > 0 && psf->error == 0) | |
59 | - return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK ; | |
60 | + return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE ; | |
61 | ||
62 | - return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR ; | |
63 | + return FLAC__STREAM_DECODER_READ_STATUS_ABORT ; | |
64 | } /* sf_flac_read_callback */ | |
65 | ||
66 | -static FLAC__SeekableStreamDecoderSeekStatus | |
67 | -sf_flac_seek_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 absolute_byte_offset, void *client_data) | |
68 | +static FLAC__StreamDecoderSeekStatus | |
69 | +sf_flac_seek_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 absolute_byte_offset, void *client_data) | |
70 | { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; | |
71 | ||
72 | psf_fseek (psf, absolute_byte_offset, SEEK_SET) ; | |
73 | if (psf->error) | |
74 | - return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR ; | |
75 | + return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR ; | |
76 | ||
77 | - return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK ; | |
78 | + return FLAC__STREAM_DECODER_SEEK_STATUS_OK ; | |
79 | } /* sf_flac_seek_callback */ | |
80 | ||
81 | -static FLAC__SeekableStreamDecoderTellStatus | |
82 | -sf_flac_tell_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 *absolute_byte_offset, void *client_data) | |
83 | +static FLAC__StreamDecoderTellStatus | |
84 | +sf_flac_tell_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 *absolute_byte_offset, void *client_data) | |
85 | { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; | |
86 | ||
87 | *absolute_byte_offset = psf_ftell (psf) ; | |
88 | if (psf->error) | |
89 | - return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR ; | |
90 | + return FLAC__STREAM_DECODER_TELL_STATUS_ERROR ; | |
91 | ||
92 | - return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK ; | |
93 | + return FLAC__STREAM_DECODER_TELL_STATUS_OK ; | |
94 | } /* sf_flac_tell_callback */ | |
95 | ||
96 | -static FLAC__SeekableStreamDecoderLengthStatus | |
97 | -sf_flac_length_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__uint64 *stream_length, void *client_data) | |
98 | +static FLAC__StreamDecoderLengthStatus | |
99 | +sf_flac_length_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__uint64 *stream_length, void *client_data) | |
100 | { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; | |
101 | ||
102 | if ((*stream_length = psf->filelength) == 0) | |
103 | - return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR ; | |
104 | + return FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR ; | |
105 | ||
106 | - return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK ; | |
107 | + return FLAC__STREAM_DECODER_LENGTH_STATUS_OK ; | |
108 | } /* sf_flac_length_callback */ | |
109 | ||
110 | static FLAC__bool | |
111 | -sf_flac_eof_callback (const FLAC__SeekableStreamDecoder *UNUSED (decoder), void *client_data) | |
112 | +sf_flac_eof_callback (const FLAC__StreamDecoder *UNUSED (decoder), void *client_data) | |
113 | { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; | |
114 | ||
115 | if (psf_ftell (psf) == psf->filelength) | |
116 | @@ -337,7 +335,7 @@ | |
117 | } /* sf_flac_eof_callback */ | |
118 | ||
119 | static FLAC__StreamDecoderWriteStatus | |
120 | -sf_flac_write_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) | |
121 | +sf_flac_write_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__Frame *frame, const FLAC__int32 * const buffer [], void *client_data) | |
122 | { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; | |
123 | FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; | |
124 | ||
125 | @@ -353,7 +351,7 @@ | |
126 | } /* sf_flac_write_callback */ | |
127 | ||
128 | static void | |
129 | -sf_flac_meta_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data) | |
130 | +sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC__StreamMetadata *metadata, void *client_data) | |
131 | { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; | |
132 | ||
133 | switch (metadata->type) | |
134 | @@ -387,7 +385,7 @@ | |
135 | } /* sf_flac_meta_callback */ | |
136 | ||
137 | static void | |
138 | -sf_flac_error_callback (const FLAC__SeekableStreamDecoder * UNUSED (decoder), FLAC__StreamDecoderErrorStatus status, void *client_data) | |
139 | +sf_flac_error_callback (const FLAC__StreamDecoder * UNUSED (decoder), FLAC__StreamDecoderErrorStatus status, void *client_data) | |
140 | { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; | |
141 | ||
142 | psf_log_printf (psf, "ERROR : %s\n", FLAC__StreamDecoderErrorStatusString [status]) ; | |
143 | @@ -407,32 +405,30 @@ | |
144 | return ; | |
145 | } /* sf_flac_error_callback */ | |
146 | ||
147 | -static FLAC__SeekableStreamEncoderSeekStatus | |
148 | -sf_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * UNUSED (encoder), FLAC__uint64 absolute_byte_offset, void *client_data) | |
149 | +static FLAC__StreamEncoderSeekStatus | |
150 | +sf_flac_enc_seek_callback (const FLAC__StreamEncoder * UNUSED (encoder), FLAC__uint64 absolute_byte_offset, void *client_data) | |
151 | { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; | |
152 | ||
153 | psf_fseek (psf, absolute_byte_offset, SEEK_SET) ; | |
154 | if (psf->error) | |
155 | - return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_ERROR ; | |
156 | + return FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR ; | |
157 | ||
158 | - return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK ; | |
159 | + return FLAC__STREAM_ENCODER_SEEK_STATUS_OK ; | |
160 | } /* sf_flac_enc_seek_callback */ | |
161 | ||
162 | -#ifdef HAVE_FLAC_1_1_1 | |
163 | -static FLAC__SeekableStreamEncoderTellStatus | |
164 | -sf_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder *UNUSED (encoder), FLAC__uint64 *absolute_byte_offset, void *client_data) | |
165 | +static FLAC__StreamEncoderTellStatus | |
166 | +sf_flac_enc_tell_callback (const FLAC__StreamEncoder *UNUSED (encoder), FLAC__uint64 *absolute_byte_offset, void *client_data) | |
167 | { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; | |
168 | ||
169 | *absolute_byte_offset = psf_ftell (psf) ; | |
170 | if (psf->error) | |
171 | - return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_ERROR ; | |
172 | + return FLAC__STREAM_ENCODER_TELL_STATUS_ERROR ; | |
173 | ||
174 | - return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_OK ; | |
175 | + return FLAC__STREAM_ENCODER_TELL_STATUS_OK ; | |
176 | } /* sf_flac_enc_tell_callback */ | |
177 | -#endif | |
178 | ||
179 | static FLAC__StreamEncoderWriteStatus | |
180 | -sf_flac_enc_write_callback (const FLAC__SeekableStreamEncoder * UNUSED (encoder), const FLAC__byte buffer [], unsigned bytes, unsigned UNUSED (samples), unsigned UNUSED (current_frame), void *client_data) | |
181 | +sf_flac_enc_write_callback (const FLAC__StreamEncoder * UNUSED (encoder), const FLAC__byte buffer [], unsigned bytes, unsigned UNUSED (samples), unsigned UNUSED (current_frame), void *client_data) | |
182 | { SF_PRIVATE *psf = (SF_PRIVATE*) client_data ; | |
183 | ||
184 | if (psf_fwrite (buffer, 1, bytes, psf) == bytes && psf->error == 0) | |
185 | @@ -509,15 +505,15 @@ | |
186 | return 0 ; | |
187 | ||
188 | if (psf->mode == SFM_WRITE) | |
189 | - { FLAC__seekable_stream_encoder_finish (pflac->fse) ; | |
190 | - FLAC__seekable_stream_encoder_delete (pflac->fse) ; | |
191 | + { FLAC__stream_encoder_finish (pflac->fse) ; | |
192 | + FLAC__stream_encoder_delete (pflac->fse) ; | |
193 | if (pflac->encbuffer) | |
194 | free (pflac->encbuffer) ; | |
195 | } ; | |
196 | ||
197 | if (psf->mode == SFM_READ) | |
198 | - { FLAC__seekable_stream_decoder_finish (pflac->fsd) ; | |
199 | - FLAC__seekable_stream_decoder_delete (pflac->fsd) ; | |
200 | + { FLAC__stream_decoder_finish (pflac->fsd) ; | |
201 | + FLAC__stream_decoder_delete (pflac->fsd) ; | |
202 | } ; | |
203 | ||
204 | for (k = 0 ; k < ARRAY_LEN (pflac->rbuffer) ; k++) | |
205 | @@ -546,17 +542,11 @@ | |
206 | return SFE_FLAC_BAD_SAMPLE_RATE ; | |
207 | ||
208 | psf_fseek (psf, 0, SEEK_SET) ; | |
209 | - if ((pflac->fse = FLAC__seekable_stream_encoder_new ()) == NULL) | |
210 | + if ((pflac->fse = FLAC__stream_encoder_new ()) == NULL) | |
211 | return SFE_FLAC_NEW_DECODER ; | |
212 | - FLAC__seekable_stream_encoder_set_write_callback (pflac->fse, sf_flac_enc_write_callback) ; | |
213 | - FLAC__seekable_stream_encoder_set_seek_callback (pflac->fse, sf_flac_enc_seek_callback) ; | |
214 | ||
215 | -#ifdef HAVE_FLAC_1_1_1 | |
216 | - FLAC__seekable_stream_encoder_set_tell_callback (pflac->fse, sf_flac_enc_tell_callback) ; | |
217 | -#endif | |
218 | - FLAC__seekable_stream_encoder_set_client_data (pflac->fse, psf) ; | |
219 | - FLAC__seekable_stream_encoder_set_channels (pflac->fse, psf->sf.channels) ; | |
220 | - FLAC__seekable_stream_encoder_set_sample_rate (pflac->fse, psf->sf.samplerate) ; | |
221 | + FLAC__stream_encoder_set_channels (pflac->fse, psf->sf.channels) ; | |
222 | + FLAC__stream_encoder_set_sample_rate (pflac->fse, psf->sf.samplerate) ; | |
223 | ||
224 | switch (psf->sf.format & SF_FORMAT_SUBMASK) | |
225 | { case SF_FORMAT_PCM_S8 : | |
226 | @@ -574,10 +564,15 @@ | |
227 | break ; | |
228 | } ; | |
229 | ||
230 | - FLAC__seekable_stream_encoder_set_bits_per_sample (pflac->fse, bps) ; | |
231 | + FLAC__stream_encoder_set_bits_per_sample (pflac->fse, bps) ; | |
232 | ||
233 | - if ((bps = FLAC__seekable_stream_encoder_init (pflac->fse)) != FLAC__SEEKABLE_STREAM_DECODER_OK) | |
234 | - { psf_log_printf (psf, "Error : FLAC encoder init returned error : %s\n", FLAC__seekable_stream_encoder_get_resolved_state_string (pflac->fse)) ; | |
235 | + if ((bps = FLAC__stream_encoder_init_stream (pflac->fse, | |
236 | + sf_flac_enc_write_callback, | |
237 | + sf_flac_enc_seek_callback, | |
238 | + sf_flac_enc_tell_callback, | |
239 | + NULL, | |
240 | + psf)) != FLAC__STREAM_ENCODER_INIT_STATUS_OK) | |
241 | + { psf_log_printf (psf, "Error : FLAC encoder init returned error : %s\n", FLAC__stream_encoder_get_resolved_state_string (pflac->fse)) ; | |
242 | return SFE_FLAC_INIT_DECODER ; | |
243 | } ; | |
244 | ||
245 | @@ -593,26 +588,25 @@ | |
246 | { FLAC_PRIVATE* pflac = (FLAC_PRIVATE*) psf->codec_data ; | |
247 | ||
248 | psf_fseek (psf, 0, SEEK_SET) ; | |
249 | - if ((pflac->fsd = FLAC__seekable_stream_decoder_new ()) == NULL) | |
250 | + if ((pflac->fsd = FLAC__stream_decoder_new ()) == NULL) | |
251 | return SFE_FLAC_NEW_DECODER ; | |
252 | ||
253 | - FLAC__seekable_stream_decoder_set_read_callback (pflac->fsd, sf_flac_read_callback) ; | |
254 | - FLAC__seekable_stream_decoder_set_seek_callback (pflac->fsd, sf_flac_seek_callback) ; | |
255 | - FLAC__seekable_stream_decoder_set_tell_callback (pflac->fsd, sf_flac_tell_callback) ; | |
256 | - FLAC__seekable_stream_decoder_set_length_callback (pflac->fsd, sf_flac_length_callback) ; | |
257 | - FLAC__seekable_stream_decoder_set_eof_callback (pflac->fsd, sf_flac_eof_callback) ; | |
258 | - FLAC__seekable_stream_decoder_set_write_callback (pflac->fsd, sf_flac_write_callback) ; | |
259 | - FLAC__seekable_stream_decoder_set_metadata_callback (pflac->fsd, sf_flac_meta_callback) ; | |
260 | - FLAC__seekable_stream_decoder_set_error_callback (pflac->fsd, sf_flac_error_callback) ; | |
261 | - FLAC__seekable_stream_decoder_set_client_data (pflac->fsd, psf) ; | |
262 | - | |
263 | - if (FLAC__seekable_stream_decoder_init (pflac->fsd) != FLAC__SEEKABLE_STREAM_DECODER_OK) | |
264 | + if (FLAC__stream_decoder_init_stream(pflac->fsd, | |
265 | + sf_flac_read_callback, | |
266 | + sf_flac_seek_callback, | |
267 | + sf_flac_tell_callback, | |
268 | + sf_flac_length_callback, | |
269 | + sf_flac_eof_callback, | |
270 | + sf_flac_write_callback, | |
271 | + sf_flac_meta_callback, | |
272 | + sf_flac_error_callback, | |
273 | + psf) != FLAC__STREAM_DECODER_INIT_STATUS_OK) | |
274 | return SFE_FLAC_INIT_DECODER ; | |
275 | ||
276 | - FLAC__seekable_stream_decoder_process_until_end_of_metadata (pflac->fsd) ; | |
277 | + FLAC__stream_decoder_process_until_end_of_metadata (pflac->fsd) ; | |
278 | if (psf->error == 0) | |
279 | { FLAC__uint64 position ; | |
280 | - FLAC__seekable_stream_decoder_get_decode_position (pflac->fsd, &position) ; | |
281 | + FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ; | |
282 | psf->dataoffset = position ; | |
283 | } ; | |
284 | ||
acff3ce2 | 285 | @@ -676,10 +670,12 @@ |
05eeb316 JB |
286 | flac_buffer_copy (psf) ; |
287 | ||
288 | while (pflac->pos < pflac->len) | |
289 | - { if (FLAC__seekable_stream_decoder_process_single (pflac->fsd) == 0) | |
290 | + { if (FLAC__stream_decoder_process_single (pflac->fsd) == 0) | |
291 | break ; | |
292 | - if (FLAC__seekable_stream_decoder_get_state (pflac->fsd) != FLAC__SEEKABLE_STREAM_DECODER_OK) | |
293 | + if (FLAC__stream_decoder_get_state (pflac->fsd) == FLAC__STREAM_DECODER_ABORTED) | |
294 | break ; | |
dd0aeb41 SS |
295 | + if (FLAC__stream_decoder_get_state (pflac->fsd) == FLAC__STREAM_DECODER_END_OF_STREAM) |
296 | + break ; | |
05eeb316 JB |
297 | } ; |
298 | ||
dd0aeb41 | 299 | pflac->ptr = NULL ; |
05eeb316 JB |
300 | @@ -795,7 +789,7 @@ |
301 | while (len > 0) | |
302 | { writecount = (len >= bufferlen) ? bufferlen : (int) len ; | |
303 | convert (ptr + total, buffer, writecount) ; | |
304 | - if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels)) | |
305 | + if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels)) | |
306 | thiswrite = writecount ; | |
307 | else | |
308 | break ; | |
309 | @@ -837,7 +831,7 @@ | |
310 | while (len > 0) | |
311 | { writecount = (len >= bufferlen) ? bufferlen : (int) len ; | |
312 | convert (ptr + total, buffer, writecount) ; | |
313 | - if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels)) | |
314 | + if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels)) | |
315 | thiswrite = writecount ; | |
316 | else | |
317 | break ; | |
318 | @@ -879,7 +873,7 @@ | |
319 | while (len > 0) | |
320 | { writecount = (len >= bufferlen) ? bufferlen : (int) len ; | |
321 | convert (ptr + total, buffer, writecount, psf->norm_float) ; | |
322 | - if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels)) | |
323 | + if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels)) | |
324 | thiswrite = writecount ; | |
325 | else | |
326 | break ; | |
327 | @@ -1011,7 +1005,7 @@ | |
328 | while (len > 0) | |
329 | { writecount = (len >= bufferlen) ? bufferlen : (int) len ; | |
330 | convert (ptr + total, buffer, writecount, psf->norm_double) ; | |
331 | - if (FLAC__seekable_stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels)) | |
332 | + if (FLAC__stream_encoder_process_interleaved (pflac->fse, buffer, writecount/psf->sf.channels)) | |
333 | thiswrite = writecount ; | |
334 | else | |
335 | break ; | |
336 | @@ -1131,8 +1125,8 @@ | |
337 | ||
338 | if (psf->mode == SFM_READ) | |
339 | { FLAC__uint64 position ; | |
340 | - if (FLAC__seekable_stream_decoder_seek_absolute (pflac->fsd, offset)) | |
341 | - { FLAC__seekable_stream_decoder_get_decode_position (pflac->fsd, &position) ; | |
342 | + if (FLAC__stream_decoder_seek_absolute (pflac->fsd, offset)) | |
343 | + { FLAC__stream_decoder_get_decode_position (pflac->fsd, &position) ; | |
344 | return offset ; | |
345 | } ; | |
346 |