Codebase list squeezelite / upstream/1.9+git20210102.78fef68
New upstream version 1.9+git20210102.78fef68 tony mancill 3 years ago
29 changed file(s) with 68 addition(s) and 42 deletion(s). Raw diff Collapse all Expand all
00 Squeezelite - lightweight headless squeezebox emulator
11
22 (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
44
55 Released under GPLv3 license:
66
1717 You should have received a copy of the GNU General Public License
1818 along with this program. If not, see <http://www.gnu.org/licenses/>.
1919
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.}
2029
2130 ---------------------------------------------------------------------
2231
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>
11 <br>
22 See the squeezelite manpage for usage details.<br>
33 https://ralph-irving.github.io/squeezelite.html<br>
1515 You should have received a copy of the GNU General Public License<br>
1616 along with this program. If not, see <http://www.gnu.org/licenses/>.<br>
1717 <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>
1828 Contains dsd2pcm library Copyright 2009, 2011 Sebastian Gesemann which<br>
1929 is subject to its own license.<br>
2030 <br>
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
1616 * You should have received a copy of the GNU General Public License
1717 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1818 *
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
2020 * -Control of Raspberry pi GPIO for amplifier power
2121 * -Launch script on power status change from LMS
2222 */
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
1616 * You should have received a copy of the GNU General Public License
1717 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1818 *
19 * Additions (c) Paul Hermann, 2015-2017 under the same license terms
19 * Additions (c) Paul Hermann, 2015-2021 under the same license terms
2020 * -Control of Raspberry pi GPIO for amplifier power
2121 * -Launch script on power status change from LMS
2222 */
2525
2626 #include <signal.h>
2727
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."
2929
3030 #define CODECS_BASE "flac,pcm,mp3,ogg"
3131 #if NO_FAAD
264264 "<https://sourceforge.net/projects/lmsclients/files/source/>\n"
265265 #endif
266266 #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"
268268 #endif
269269 #if ALAC
270270 "\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"
272272 #endif
273273 "\n"
274274 );
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
66 *
77 * This program is free software: you can redistribute it and/or modify
88 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
440440 output.fade = FADE_INACTIVE;
441441 if (output.state != OUTPUT_OFF) {
442442 output.state = OUTPUT_STOPPED;
443 output.stop_time = gettime_ms();
443444 if (output.error_opening) {
444445 output.current_sample_rate = output.default_sample_rate;
445446 }
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
1616 * You should have received a copy of the GNU General Public License
1717 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1818 *
19 * Additions (c) Paul Hermann, 2015-2017 under the same license terms
19 * Additions (c) Paul Hermann, 2015-2021 under the same license terms
2020 * -Control of Raspberry pi GPIO for amplifier power
2121 * -Launch script on power status change from LMS
2222 */
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
1616 * You should have received a copy of the GNU General Public License
1717 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1818 *
19 * Additions (c) Paul Hermann, 2015-2017 under the same license terms
19 * Additions (c) Paul Hermann, 2015-2021 under the same license terms
2020 * -Control of Raspberry pi GPIO for amplifier power
2121 * -Launch script on power status change from LMS
2222 */
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
1616 * You should have received a copy of the GNU General Public License
1717 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1818 *
19 * Additions (c) Paul Hermann, 2015-2017 under the same license terms
19 * Additions (c) Paul Hermann, 2015-2021 under the same license terms
2020 * -Control of Raspberry pi GPIO for amplifier power
2121 * -Launch script on power status change from LMS
2222 */
9595 u8_t *ptr = packet;
9696 unsigned try = 0;
9797 ssize_t n;
98 int error;
9899
99100 while (len) {
100101 n = send(sock, ptr, len, MSG_NOSIGNAL);
101102 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
103109 LOG_DEBUG("retrying (%d) writing to socket", ++try);
104110 usleep(1000);
105111 continue;
106112 }
107 LOG_INFO("failed writing to socket: %s", strerror(last_error()));
113 LOG_WARN("failed writing to socket: %s", strerror(last_error()));
108114 return;
109115 }
110116 ptr += n;
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
1616 * You should have received a copy of the GNU General Public License
1717 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1818 *
19 * Additions (c) Paul Hermann, 2015-2017 under the same license terms
19 * Additions (c) Paul Hermann, 2015-2021 under the same license terms
2020 * -Control of Raspberry pi GPIO for amplifier power
2121 * -Launch script on power status change from LMS
2222 */
2525
2626 #define MAJOR_VERSION "1.9"
2727 #define MINOR_VERSION "8"
28 #define MICRO_VERSION "1307"
28 #define MICRO_VERSION "1317"
2929
3030 #if defined(CUSTOM_VERSION)
3131 #define VERSION "v" MAJOR_VERSION "." MINOR_VERSION "-" MICRO_VERSION STR(CUSTOM_VERSION)
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by
11 * Squeezelite - lightweight headless squeezebox emulator
22 *
33 * (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
55 *
66 * This program is free software: you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License as published by