FLAC but no MP3

This commit is contained in:
philippe44
2019-05-19 18:42:44 -07:00
parent a5047e4209
commit 1fd1d9bf60
5 changed files with 17 additions and 8 deletions

View File

@@ -80,7 +80,7 @@ static void *decode_thread() {
IF_PROCESS(
min_space = process.max_out_frames * BYTES_PER_FRAME;
);
if (space > min_space && (bytes > codec->min_read_bytes || toend)) {
decode.state = codec->decode();
@@ -172,16 +172,18 @@ void decode_init(log_level level, const char *include_codecs, const char *exclud
#endif
if (!strstr(exclude_codecs, "ogg") && (!include_codecs || (order_codecs = strstr(include_codecs, "ogg"))))
sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_vorbis());
*/
if (!strstr(exclude_codecs, "flac") && (!include_codecs || (order_codecs = strstr(include_codecs, "flac"))))
sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_flac());
*/
if (!strstr(exclude_codecs, "pcm") && (!include_codecs || (order_codecs = strstr(include_codecs, "pcm"))))
sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_pcm());
/*
// try mad then mpg for mp3 unless command line option passed
if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) &&
(!include_codecs || (order_codecs = strstr(include_codecs, "mp3")) || (order_codecs = strstr(include_codecs, "mad"))))
sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mad());
/*
else if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) &&
(!include_codecs || (order_codecs = strstr(include_codecs, "mp3")) || (order_codecs = strstr(include_codecs, "mpg"))))
sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mpg());

View File

@@ -10,3 +10,7 @@ void get_mac(u8_t mac[]) {
_sig_func_ptr signal(int sig, _sig_func_ptr func) {
return NULL;
}
void *audio_calloc(size_t nmemb, size_t size) {
return calloc(nmemb, size);
}

View File

@@ -145,13 +145,16 @@ static void *output_thread() {
output.frames_played_dmp = output.frames_played;
_output_frames(FRAME_BLOCK);
UNLOCK;
if (buffill) {
//fwrite(buf, bytes_per_frame, buffill, stdout);
// do something ...
usleep((buffill * 1000 * 1000) / output.current_sample_rate);
buffill = 0;
}
} else {
usleep((FRAME_BLOCK * 1000 * 1000) / output.current_sample_rate);
}
}

2
scan.c
View File

@@ -125,7 +125,7 @@ void app_main()
"-d",
"all=info",
"-b",
"128:2000",
"256:2000",
};
// can't do strtok on FLASH strings

View File

@@ -281,7 +281,7 @@
#endif /* SUN */
#define STREAM_THREAD_STACK_SIZE 8 * 1024
#define DECODE_THREAD_STACK_SIZE 8 * 1024
#define DECODE_THREAD_STACK_SIZE 32 * 1024
#define OUTPUT_THREAD_STACK_SIZE 8 * 1024
#define IR_THREAD_STACK_SIZE 8 * 1024
#if !OSX