Update upstream source from tag 'upstream/1.9+git20210102.78fef68'
Update to upstream version '1.9+git20210102.78fef68'
with Debian dir 391f15b9028a36f1969b79865baf913e3c08e6c1
tony mancill
2 years ago
0 | 0 | Squeezelite - lightweight headless squeezebox emulator |
1 | 1 | |
2 | 2 | (c) Adrian Smith 2012-2015, triode1@btinternet.com |
3 | Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
3 | Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
4 | 4 | |
5 | 5 | Released under GPLv3 license: |
6 | 6 | |
17 | 17 | You should have received a copy of the GNU General Public License |
18 | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 | 19 | |
20 | Additional permission under GNU GPL version 3 section 7 | |
21 | ||
22 | If you modify this program, or any covered work, by linking or | |
23 | combining it with OpenSSL (or a modified version of that library), | |
24 | containing parts covered by the terms of The OpenSSL Project, the | |
25 | licensors of this program grant you additional permission to convey | |
26 | the resulting work. {Corresponding source for a non-source form of | |
27 | such a combination shall include the source code for the parts of | |
28 | OpenSSL used as well as that of the covered work.} | |
20 | 29 | |
21 | 30 | --------------------------------------------------------------------- |
22 | 31 |
0 | Squeezelite v1.9.x, Copyright 2012-2015 Adrian Smith, 2015-2019 Ralph Irving.<br> | |
0 | Squeezelite v1.9.x, Copyright 2012-2015 Adrian Smith, 2015-2021 Ralph Irving.<br> | |
1 | 1 | <br> |
2 | 2 | See the squeezelite manpage for usage details.<br> |
3 | 3 | https://ralph-irving.github.io/squeezelite.html<br> |
15 | 15 | You should have received a copy of the GNU General Public License<br> |
16 | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>.<br> |
17 | 17 | <br> |
18 | Additional permission under GNU GPL version 3 section 7<br> | |
19 | <br> | |
20 | If you modify this program, or any covered work, by linking or | |
21 | combining it with OpenSSL (or a modified version of that library), | |
22 | containing parts covered by the terms of The OpenSSL Project, the | |
23 | licensors of this program grant you additional permission to convey | |
24 | the resulting work. {Corresponding source for a non-source form of | |
25 | such a combination shall include the source code for the parts of | |
26 | OpenSSL used as well as that of the covered work.}<br> | |
27 | <br> | |
18 | 28 | Contains dsd2pcm library Copyright 2009, 2011 Sebastian Gesemann which<br> |
19 | 29 | is subject to its own license.<br> |
20 | 30 | <br> |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
16 | 16 | * You should have received a copy of the GNU General Public License |
17 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | * |
19 | * gpio.c (c) Paul Hermann, 2015-2017 under the same license terms | |
19 | * gpio.c (c) Paul Hermann, 2015-2021 under the same license terms | |
20 | 20 | * -Control of Raspberry pi GPIO for amplifier power |
21 | 21 | * -Launch script on power status change from LMS |
22 | 22 | */ |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2020, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
16 | 16 | * You should have received a copy of the GNU General Public License |
17 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | * |
19 | * Additions (c) Paul Hermann, 2015-2017 under the same license terms | |
19 | * Additions (c) Paul Hermann, 2015-2021 under the same license terms | |
20 | 20 | * -Control of Raspberry pi GPIO for amplifier power |
21 | 21 | * -Launch script on power status change from LMS |
22 | 22 | */ |
25 | 25 | |
26 | 26 | #include <signal.h> |
27 | 27 | |
28 | #define TITLE "Squeezelite " VERSION ", Copyright 2012-2015 Adrian Smith, 2015-2020 Ralph Irving." | |
28 | #define TITLE "Squeezelite " VERSION ", Copyright 2012-2015 Adrian Smith, 2015-2021 Ralph Irving." | |
29 | 29 | |
30 | 30 | #define CODECS_BASE "flac,pcm,mp3,ogg" |
31 | 31 | #if NO_FAAD |
264 | 264 | "<https://sourceforge.net/projects/lmsclients/files/source/>\n" |
265 | 265 | #endif |
266 | 266 | #if OPUS |
267 | "\nOpus decoder support (c) Philippe 2018-2019, philippe_44@outlook.com\n" | |
267 | "\nOpus decoder support (c) Philippe 2018-2021, philippe_44@outlook.com\n" | |
268 | 268 | #endif |
269 | 269 | #if ALAC |
270 | 270 | "\nContains Apple Lossless (ALAC) decoder. Apache License Version 2.0\n" |
271 | "Apple ALAC decoder support (c) Philippe 2018-2019, philippe_44@outlook.com\n" | |
271 | "Apple ALAC decoder support (c) Philippe 2018-2021, philippe_44@outlook.com\n" | |
272 | 272 | #endif |
273 | 273 | "\n" |
274 | 274 | ); |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
5 | * Philippe 2018-2019, philippe_44@outlook.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | * Philippe 2018-2021, philippe_44@outlook.com | |
6 | 6 | * |
7 | 7 | * This program is free software: you can redistribute it and/or modify |
8 | 8 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
440 | 440 | output.fade = FADE_INACTIVE; |
441 | 441 | if (output.state != OUTPUT_OFF) { |
442 | 442 | output.state = OUTPUT_STOPPED; |
443 | output.stop_time = gettime_ms(); | |
443 | 444 | if (output.error_opening) { |
444 | 445 | output.current_sample_rate = output.default_sample_rate; |
445 | 446 | } |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
16 | 16 | * You should have received a copy of the GNU General Public License |
17 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | * |
19 | * Additions (c) Paul Hermann, 2015-2017 under the same license terms | |
19 | * Additions (c) Paul Hermann, 2015-2021 under the same license terms | |
20 | 20 | * -Control of Raspberry pi GPIO for amplifier power |
21 | 21 | * -Launch script on power status change from LMS |
22 | 22 | */ |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2020, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
16 | 16 | * You should have received a copy of the GNU General Public License |
17 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | * |
19 | * Additions (c) Paul Hermann, 2015-2017 under the same license terms | |
19 | * Additions (c) Paul Hermann, 2015-2021 under the same license terms | |
20 | 20 | * -Control of Raspberry pi GPIO for amplifier power |
21 | 21 | * -Launch script on power status change from LMS |
22 | 22 | */ |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
16 | 16 | * You should have received a copy of the GNU General Public License |
17 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | * |
19 | * Additions (c) Paul Hermann, 2015-2017 under the same license terms | |
19 | * Additions (c) Paul Hermann, 2015-2021 under the same license terms | |
20 | 20 | * -Control of Raspberry pi GPIO for amplifier power |
21 | 21 | * -Launch script on power status change from LMS |
22 | 22 | */ |
95 | 95 | u8_t *ptr = packet; |
96 | 96 | unsigned try = 0; |
97 | 97 | ssize_t n; |
98 | int error; | |
98 | 99 | |
99 | 100 | while (len) { |
100 | 101 | n = send(sock, ptr, len, MSG_NOSIGNAL); |
101 | 102 | if (n <= 0) { |
102 | if (n < 0 && last_error() == ERROR_WOULDBLOCK && try < 10) { | |
103 | error = last_error(); | |
104 | #if WIN | |
105 | if (n < 0 && (error == ERROR_WOULDBLOCK || error == WSAENOTCONN) && try < 10) { | |
106 | #else | |
107 | if (n < 0 && error == ERROR_WOULDBLOCK && try < 10) { | |
108 | #endif | |
103 | 109 | LOG_DEBUG("retrying (%d) writing to socket", ++try); |
104 | 110 | usleep(1000); |
105 | 111 | continue; |
106 | 112 | } |
107 | LOG_INFO("failed writing to socket: %s", strerror(last_error())); | |
113 | LOG_WARN("failed writing to socket: %s", strerror(last_error())); | |
108 | 114 | return; |
109 | 115 | } |
110 | 116 | ptr += n; |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
16 | 16 | * You should have received a copy of the GNU General Public License |
17 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 | * |
19 | * Additions (c) Paul Hermann, 2015-2017 under the same license terms | |
19 | * Additions (c) Paul Hermann, 2015-2021 under the same license terms | |
20 | 20 | * -Control of Raspberry pi GPIO for amplifier power |
21 | 21 | * -Launch script on power status change from LMS |
22 | 22 | */ |
25 | 25 | |
26 | 26 | #define MAJOR_VERSION "1.9" |
27 | 27 | #define MINOR_VERSION "8" |
28 | #define MICRO_VERSION "1307" | |
28 | #define MICRO_VERSION "1317" | |
29 | 29 | |
30 | 30 | #if defined(CUSTOM_VERSION) |
31 | 31 | #define VERSION "v" MAJOR_VERSION "." MINOR_VERSION "-" MICRO_VERSION STR(CUSTOM_VERSION) |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2017, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |
1 | 1 | * Squeezelite - lightweight headless squeezebox emulator |
2 | 2 | * |
3 | 3 | * (c) Adrian Smith 2012-2015, triode1@btinternet.com |
4 | * Ralph Irving 2015-2020, ralph_irving@hotmail.com | |
4 | * Ralph Irving 2015-2021, ralph_irving@hotmail.com | |
5 | 5 | * |
6 | 6 | * This program is free software: you can redistribute it and/or modify |
7 | 7 | * it under the terms of the GNU General Public License as published by |