diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-freebsd-x86_64 b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-freebsd-x86_64 index 87d74f7e..c8e44ce7 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-freebsd-x86_64 and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-freebsd-x86_64 differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-aarch64 b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-aarch64 index 3cdcd071..7829fd5e 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-aarch64 and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-aarch64 differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-arm b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-arm index 73366220..682cb3d2 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-arm and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-arm differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-armv5 b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-armv5 index 22272845..aeaa171f 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-armv5 and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-armv5 differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-armv6 b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-armv6 index 684660e5..8f5bf655 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-armv6 and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-armv6 differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-mips b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-mips index 795621ad..a1655373 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-mips and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-mips differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-powerpc b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-powerpc index d1d05513..deafdf7f 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-powerpc and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-powerpc differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-sparc64 b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-sparc64 index c390c2b5..26dd758c 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-sparc64 and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-sparc64 differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-x86 b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-x86 index 9f3debe9..f962b085 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-x86 and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-x86 differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-x86_64 b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-x86_64 index 30bc214e..057fd0d9 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-x86_64 and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-linux-x86_64 differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos index 23d4b955..c5b37f05 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos-arm64 b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos-arm64 index 6093698e..0a03a119 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos-arm64 and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos-arm64 differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos-x86_64 b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos-x86_64 index 4b00bdd9..b47bdcd1 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos-x86_64 and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-macos-x86_64 differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-solaris-x86_64 b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-solaris-x86_64 index fb3d2b9a..a577fa84 100644 Binary files a/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-solaris-x86_64 and b/components/spotify/cspot/bell/external/mdnssvc/bin/climdnssvc-solaris-x86_64 differ diff --git a/components/spotify/cspot/bell/external/mdnssvc/climdnssvc.c b/components/spotify/cspot/bell/external/mdnssvc/climdnssvc.c index 5d9fe7a3..a9f7d29e 100644 --- a/components/spotify/cspot/bell/external/mdnssvc/climdnssvc.c +++ b/components/spotify/cspot/bell/external/mdnssvc/climdnssvc.c @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) { } else if (!strcasecmp(arg, "-i")) { identity = *++argv; } else { - // nothing let's try to be smart and handle legacy crappy + // nothing let's try to be smart and handle legacy crap if (!identity) identity = *argv; else if (!type) (void) !asprintf(&type, "%s.local", *argv); else if (!port) port = atoi(*argv); @@ -235,6 +235,7 @@ int main(int argc, char *argv[]) { txt = (const char**) malloc((argc + 1) * sizeof(char**)); memcpy(txt, argv, argc * sizeof(char**)); txt[argc] = NULL; + break; } argc--; } @@ -250,13 +251,14 @@ int main(int argc, char *argv[]) { mdnsd_set_hostname(svr, hostname, host); svc = mdnsd_register_svc(svr, identity, type, port, NULL, txt); - mdns_service_destroy(svc); + // mdns_service_destroy(svc); #ifdef _WIN32 Sleep(INFINITE); #else pause(); #endif + mdns_service_remove(svr, svc); mdnsd_stop(svr); } else { printf("Can't start server"); @@ -264,7 +266,7 @@ int main(int argc, char *argv[]) { } free(type); - free(txt); + if (txt) free(txt); #ifdef _WIN32 winsock_close(); diff --git a/components/spotify/cspot/bell/external/mdnssvc/mdnsd.c b/components/spotify/cspot/bell/external/mdnssvc/mdnsd.c index fa73f49f..0f4461a5 100644 --- a/components/spotify/cspot/bell/external/mdnssvc/mdnsd.c +++ b/components/spotify/cspot/bell/external/mdnssvc/mdnsd.c @@ -144,11 +144,10 @@ static int create_recv_sock(uint32_t host) { } #if !defined(_WIN32) - on = sizeof(on); - socklen_t len; - if (!getsockopt(sd, SOL_SOCKET, SO_REUSEPORT,(char*) &on, &len)) { + socklen_t len = sizeof(on); + if (!getsockopt(sd, SOL_SOCKET, SO_REUSEPORT, &on, &len)) { on = 1; - if ((r = setsockopt(sd, SOL_SOCKET, SO_REUSEPORT,(char*) &on, sizeof(on))) < 0) { + if ((r = setsockopt(sd, SOL_SOCKET, SO_REUSEPORT, &on, sizeof(on))) < 0) { log_message(LOG_ERR, "recv setsockopt(SO_REUSEPORT): %m\n", r); } } diff --git a/components/squeezelite/output.c b/components/squeezelite/output.c index 8594f9ef..982b6466 100644 --- a/components/squeezelite/output.c +++ b/components/squeezelite/output.c @@ -443,7 +443,7 @@ void output_close_common(void) { } void output_flush(void) { - LOG_INFO("flush output buffer"); + LOG_INFO("flush output buffer (full)"); buf_flush(outputbuf); LOCK; output.fade = FADE_INACTIVE; @@ -457,3 +457,15 @@ void output_flush(void) { output.frames_played = 0; UNLOCK; } + +bool output_flush_streaming(void) { + LOG_INFO("flush output buffer (streaming)"); + LOCK; + bool flushed = output.track_start != NULL; + if (output.track_start) { + outputbuf->writep = output.track_start; + output.track_start = NULL; + } + UNLOCK; + return flushed; +} diff --git a/components/squeezelite/slimproto.c b/components/squeezelite/slimproto.c index d62e75ca..1cfe5fbd 100644 --- a/components/squeezelite/slimproto.c +++ b/components/squeezelite/slimproto.c @@ -305,8 +305,18 @@ static void process_strm(u8_t *pkt, int len) { sendSTAT("STMt", strm->replay_gain); // STMt replay_gain is no longer used to track latency, but support it break; case 'f': + { + decode_flush(false); + bool flushed = false; + if (!output.external) flushed |= output_flush_streaming(); + // we can have fully finished the current streaming, that's still a flush + if (stream_disconnect() || flushed) sendSTAT("STMf", 0); + buf_flush(streambuf); + output.stop_time = gettime_ms(); + break; + } case 'q': - decode_flush(strm->command == 'q'); + decode_flush(true); if (!output.external) output_flush(); status.frames_played = 0; if (stream_disconnect() && strm->command == 'f') sendSTAT("STMf", 0); diff --git a/components/squeezelite/squeezelite.h b/components/squeezelite/squeezelite.h index 60ac4f64..5b236669 100644 --- a/components/squeezelite/squeezelite.h +++ b/components/squeezelite/squeezelite.h @@ -727,6 +727,7 @@ struct outputstate { void output_init_common(log_level level, const char *device, unsigned output_buf_size, unsigned rates[], unsigned idle); void output_close_common(void); void output_flush(void); +bool output_flush_streaming(void); // _* called with mutex locked frames_t _output_frames(frames_t avail); void _checkfade(bool);