Merge branch 'nvs_parameters' of https://github.com/sle118/squeezelite-esp32.git into nvs_parameters

This commit is contained in:
Sebastien
2019-11-06 23:31:26 -05:00
6 changed files with 20 additions and 13 deletions

View File

@@ -185,9 +185,6 @@ struct raop_ctx_s *raop_create(struct in_addr host, char *name,
#ifdef WIN32
// seems that Windows snprintf does not add NULL char if actual size > max
id[63] = '\0';
ctx->svc = mdnsd_register_svc(ctx->svr, id, "_raop._tcp.local", ctx->port, NULL, (const char**) txt);
pthread_create(&ctx->thread, NULL, &rtsp_thread, ctx);
ctx->svc = mdnsd_register_svc(ctx->svr, id, "_raop._tcp.local", ctx->port, NULL, (const char**) txt);
pthread_create(&ctx->thread, NULL, &rtsp_thread, ctx);
@@ -221,6 +218,7 @@ void raop_delete(struct raop_ctx_s *ctx) {
// wake-up thread by connecting socket, needed for freeBSD
sock = socket(AF_INET, SOCK_STREAM, 0);
getsockname(ctx->sock, (struct sockaddr *) &addr, &nlen);
connect(sock, (struct sockaddr*) &addr, sizeof(addr));
closesocket(sock);
#ifdef WIN32
@@ -369,7 +367,7 @@ static void *rtsp_thread(void *arg) {
if (n > 0) res = handle_rtsp(ctx, sock);
if (n < 0 || !res) {
closesocket(sock);
closesocket(sock);
LOG_INFO("RTSP close %u", sock);
sock = -1;
}

View File

@@ -305,6 +305,7 @@ void rtp_end(rtp_t *ctx)
ctx->running = false;
#ifdef WIN32
pthread_join(ctx->thread, NULL);
#else
xTaskNotifyWait(0, 0, NULL, portMAX_DELAY);
vTaskDelete(ctx->thread);
free(ctx->xStack);
@@ -709,7 +710,7 @@ static void *rtp_thread_func(void *arg) {
free(packet);
LOG_INFO("[%p]: terminating", ctx);
#ifndef WIN32
xTaskNotify(ctx->joiner, 0, eNoAction);
vTaskSuspend(NULL);