diff --git a/components/display/CMakeLists.txt b/components/display/CMakeLists.txt index 6b80fe50..01886005 100644 --- a/components/display/CMakeLists.txt +++ b/components/display/CMakeLists.txt @@ -1,4 +1,3 @@ - idf_component_register(SRC_DIRS . core core/ifaces fonts INCLUDE_DIRS . fonts core REQUIRES platform_config tools esp_common diff --git a/components/raop/raop.c b/components/raop/raop.c index ccd9e4b7..20412d73 100644 --- a/components/raop/raop.c +++ b/components/raop/raop.c @@ -228,7 +228,6 @@ void raop_delete(struct raop_ctx_s *ctx) { closesocket(sock); pthread_join(ctx->thread, NULL); - rtp_end(ctx->rtp); shutdown(ctx->sock, SD_BOTH); @@ -247,14 +246,17 @@ void raop_delete(struct raop_ctx_s *ctx) { // then the RTSP task ctx->joiner = xTaskGetCurrentTaskHandle(); ctx->running = false; + + // brute-force exit of accept() + shutdown(ctx->sock, SHUT_RDWR); + closesocket(ctx->sock); + // wait to make sure LWIP if scheduled (avoid issue with NotifyTake) + vTaskDelay(100 / portTICK_PERIOD_MS); ulTaskNotifyTake(pdFALSE, portMAX_DELAY); vTaskDelete(ctx->thread); heap_caps_free(ctx->xTaskBuffer); - shutdown(ctx->sock, SHUT_RDWR); - closesocket(ctx->sock); - // cleanup all session-created items cleanup_rtsp(ctx, true); diff --git a/components/squeezelite/decode_external.c b/components/squeezelite/decode_external.c index e0ea344d..c52ce7e3 100644 --- a/components/squeezelite/decode_external.c +++ b/components/squeezelite/decode_external.c @@ -327,12 +327,12 @@ void register_external(void) { void deregister_external(void) { if (!strcasestr(output.device, "BT ") && enable_bt_sink) { - bt_sink_deinit(); LOG_INFO("Stopping BT sink"); + bt_sink_deinit(); } if (enable_airplay){ + LOG_INFO("Stopping AirPlay sink"); raop_sink_deinit(); - LOG_INFO("Stopping AirPlay sink"); } } diff --git a/components/squeezelite/embedded.h b/components/squeezelite/embedded.h index 580b4059..457fb310 100644 --- a/components/squeezelite/embedded.h +++ b/components/squeezelite/embedded.h @@ -35,7 +35,7 @@ typedef unsigned long long u64_t; #define OUTPUT_THREAD_STACK_SIZE 6 * 1024 #define IR_THREAD_STACK_SIZE 6 * 1024 -// number of 5s times search for a server will happen beforee slimproto exits (0 = no limit) +// number of times the 5s search for a server will happen before slimproto exits (0 = no limit) #define MAX_SERVER_RETRIES 5 // or can be as simple as #define PLAYER_ID 100 diff --git a/components/squeezelite/slimproto.c b/components/squeezelite/slimproto.c index 8064e4a6..8dd05b54 100644 --- a/components/squeezelite/slimproto.c +++ b/components/squeezelite/slimproto.c @@ -962,7 +962,7 @@ void slimproto(log_level level, char *server, u8_t mac[6], const char *name, con if (++failed_connect > 5 && !server) { slimproto_ip = serv_addr.sin_addr.s_addr = discover_server(NULL, MAX_SERVER_RETRIES); if (!slimproto_ip) return; - } else if (MAX_SERVER_RETRIES && failed_connect > 5 * MAX_SERVER_RETRIES) return; + } else if (reconnect && MAX_SERVER_RETRIES && failed_connect > 5 * MAX_SERVER_RETRIES) return; #else // rediscover server if it was not set at startup or exit if (!server && ++failed_connect > 5) {