New upstream version 1.9.9-1392+git20211113.3ffdbb9
tony mancill
2 years ago
0 | 0 | # OSX 11.0+ arm64 only |
1 | OPTS = -DPORTAUDIO -DALAC -DOPUS -DRESAMPLE -DLINKALL -DVISEXPORT -DDSD -DUSE_SSL -I./includem1 -I./includem1/opus -I./includem1/alac -arch arm64 -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.0 | |
1 | OPTS = -DPORTAUDIO -DALAC -DOPUS -DRESAMPLE -DLINKALL -DVISEXPORT -DDSD -DUSE_SSL -I./includem1 -I./includem1/opus -I./includem1/alac -arch arm64 -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=11.0 | |
2 | 2 | |
3 | LDFLAGS = -arch arm64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=11.0 -L./libm1 | |
3 | LDFLAGS = -arch arm64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=11.0 -L./libm1 | |
4 | 4 | |
5 | 5 | LDADD = -lportaudio -lpthread -ldl -lm -framework CoreVideo -framework VideoDecodeAcceleration -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon |
6 | 6 |
122 | 122 | |
123 | 123 | *want = bytes; |
124 | 124 | |
125 | // if there's nothing in the stream buffer, libFLAC will continuously call this function as quickly as possible. slow it down. | |
126 | if (!bytes && !end) | |
127 | usleep(1000); | |
128 | ||
125 | 129 | return end ? FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM : FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; |
126 | 130 | } |
127 | 131 |
229 | 229 | if (stream.state <= DISCONNECT) { |
230 | 230 | LOG_INFO("partial decode"); |
231 | 231 | UNLOCK_O_direct; |
232 | UNLOCK_S; | |
233 | 232 | return DECODE_COMPLETE; |
234 | 233 | } else { |
235 | 234 | LOG_INFO("no frame decoded"); |
390 | 390 | output.idle_to = (u32_t) idle; |
391 | 391 | |
392 | 392 | /* Skip test_open for stdout, set default sample rates */ |
393 | if ( output.device[0] == '-' ) { | |
393 | if ( output.device[0] == '-' || user_rates ) { | |
394 | 394 | for (i = 0; i < MAX_SUPPORTED_SAMPLERATES; ++i) { |
395 | 395 | output.supported_rates[i] = rates[i]; |
396 | 396 | } |
399 | 399 | if (!test_open(output.device, output.supported_rates, user_rates)) { |
400 | 400 | LOG_ERROR("unable to open output device: %s", output.device); |
401 | 401 | exit(0); |
402 | } | |
403 | } | |
404 | ||
405 | if (user_rates) { | |
406 | for (i = 0; i < MAX_SUPPORTED_SAMPLERATES; ++i) { | |
407 | output.supported_rates[i] = rates[i]; | |
408 | 402 | } |
409 | 403 | } |
410 | 404 |
296 | 296 | if (snd_pcm_hw_params_test_rate(pcm, hw_params, ref[i], 0) == 0) { |
297 | 297 | rates[ind++] = ref[i]; |
298 | 298 | } |
299 | else { | |
300 | LOG_DEBUG("sample rate %u not supported", ref[i]); | |
301 | } | |
299 | 302 | } |
300 | 303 | } |
301 | 304 |
213 | 213 | #endif |
214 | 214 | switch (err) { |
215 | 215 | case paInvalidSampleRate: |
216 | LOG_DEBUG("sample rate %u not supported", ref[i]); | |
216 | 217 | continue; |
217 | 218 | #if WIN |
218 | 219 | #ifndef PA18API |
62 | 62 | #define MAX_DECODE_FRAMES 4096 |
63 | 63 | |
64 | 64 | static u32_t sample_rates[] = { |
65 | 11025, 22050, 32000, 44100, 48000, 8000, 12000, 16000, 24000, 96000, 88200, 176400, 192000, 352800, 384000, 705600, 768000 | |
65 | 11025, 22050, 32000, 44100, 48000, 8000, 12000, 16000, 24000, 96000, 88200, 176400, 192000, 352800, 384000, 705600, 768000, 1411200, 1536000 | |
66 | 66 | }; |
67 | 67 | |
68 | 68 | static u32_t sample_rate; |
25 | 25 | |
26 | 26 | #define MAJOR_VERSION "1.9" |
27 | 27 | #define MINOR_VERSION "9" |
28 | #define MICRO_VERSION "1386" | |
28 | #define MICRO_VERSION "1392" | |
29 | 29 | |
30 | 30 | #if defined(CUSTOM_VERSION) |
31 | 31 | #define VERSION "v" MAJOR_VERSION "." MINOR_VERSION "-" MICRO_VERSION STR(CUSTOM_VERSION) |
616 | 616 | |
617 | 617 | #define MONO_RIGHT 0x02 |
618 | 618 | #define MONO_LEFT 0x01 |
619 | #define MAX_SUPPORTED_SAMPLERATES 18 | |
620 | #define TEST_RATES = { 768000, 705600, 384000, 352800, 192000, 176400, 96000, 88200, 48000, 44100, 32000, 24000, 22500, 16000, 12000, 11025, 8000, 0 } | |
619 | #define MAX_SUPPORTED_SAMPLERATES 20 | |
620 | #define TEST_RATES = { 1536000, 1411200, 768000, 705600, 384000, 352800, 192000, 176400, 96000, 88200, 48000, 44100, 32000, 24000, 22500, 16000, 12000, 11025, 8000, 0 } | |
621 | 621 | |
622 | 622 | struct outputstate { |
623 | 623 | output_state state; |