39 |
39 |
/* Define to read all frame headers when calculating file length */
|
40 |
40 |
/* #define FULL_SCAN */
|
41 |
41 |
|
|
42 |
#define DECODE_OPTIONS (MPG123_QUIET | MPG123_GAPLESS | MPG123_SEEKBUFFER | MPG123_FUZZY)
|
|
43 |
|
42 |
44 |
static ssize_t replace_read (void * file, void * buffer, size_t length)
|
43 |
45 |
{
|
44 |
46 |
return vfs_fread (buffer, 1, length, file);
|
... | ... | |
118 |
120 |
}
|
119 |
121 |
|
120 |
122 |
mpg123_handle * dec = mpg123_new (NULL, NULL);
|
121 |
|
mpg123_param (dec, MPG123_ADD_FLAGS, MPG123_QUIET, 0);
|
|
123 |
mpg123_param (dec, MPG123_ADD_FLAGS, DECODE_OPTIONS, 0);
|
122 |
124 |
|
123 |
125 |
if (is_streaming)
|
124 |
126 |
mpg123_replace_reader_handle (dec, replace_read, replace_lseek_dummy, NULL);
|
... | ... | |
181 |
183 |
struct mpg123_frameinfo info;
|
182 |
184 |
char scratch[32];
|
183 |
185 |
|
184 |
|
mpg123_param (decoder, MPG123_ADD_FLAGS, MPG123_QUIET, 0);
|
|
186 |
mpg123_param (decoder, MPG123_ADD_FLAGS, DECODE_OPTIONS, 0);
|
185 |
187 |
|
186 |
188 |
if (stream)
|
187 |
189 |
mpg123_replace_reader_handle (decoder, replace_read, replace_lseek_dummy, NULL);
|
... | ... | |
321 |
323 |
ctx.tu = ctx.stream ? get_stream_tuple (filename, file) : NULL;
|
322 |
324 |
|
323 |
325 |
ctx.decoder = mpg123_new (NULL, NULL);
|
324 |
|
mpg123_param (ctx.decoder, MPG123_ADD_FLAGS, MPG123_QUIET, 0);
|
325 |
|
mpg123_param (ctx.decoder, MPG123_ADD_FLAGS, MPG123_GAPLESS, 0);
|
326 |
|
mpg123_param (ctx.decoder, MPG123_ADD_FLAGS, MPG123_SEEKBUFFER, 0);
|
|
326 |
mpg123_param (ctx.decoder, MPG123_ADD_FLAGS, DECODE_OPTIONS, 0);
|
327 |
327 |
|
328 |
328 |
if (ctx.stream)
|
329 |
329 |
mpg123_replace_reader_handle (ctx.decoder, replace_read, replace_lseek_dummy, NULL);
|