From 0bf2c11fdb1a1edcb3ac4c0a96cf9768f7123d0c Mon Sep 17 00:00:00 2001 From: philippe44 Date: Sun, 1 Mar 2020 00:25:09 -0800 Subject: [PATCH] Correcting annoying AirPlay bug! - release --- components/display/display.c | 2 +- components/raop/raop.c | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/display/display.c b/components/display/display.c index 0cdbe25c..ddc79a0a 100644 --- a/components/display/display.c +++ b/components/display/display.c @@ -192,7 +192,7 @@ static void displayer_task(void *args) { // handler elapsed track time if (displayer.timer && displayer.state == DISPLAYER_ACTIVE) { - char counter[12]; + char counter[16]; TickType_t tick = xTaskGetTickCount(); uint32_t elapsed = (tick - displayer.tick) * portTICK_PERIOD_MS; diff --git a/components/raop/raop.c b/components/raop/raop.c index 07eab618..4d824f7e 100644 --- a/components/raop/raop.c +++ b/components/raop/raop.c @@ -631,11 +631,9 @@ static bool handle_rtsp(raop_ctx_t *ctx, int sock) current = ((current - start) / 44100) * 1000; if (stop) stop = ((stop - start) / 44100) * 1000; else stop = -1; - LOG_INFO("[%p]: SET PARAMETER progress %u/%u %s", ctx, current, stop, p); - success = ctx->cmd_cb(RAOP_PROGRESS, current, stop); - } - - if (body && ((p = kd_lookup(headers, "Content-Type")) != NULL) && !strcasecmp(p, "application/x-dmap-tagged")) { + LOG_INFO("[%p]: SET PARAMETER progress %d/%u %s", ctx, current, stop, p); + success = ctx->cmd_cb(RAOP_PROGRESS, max(current, 0), stop); + } else if (body && ((p = kd_lookup(headers, "Content-Type")) != NULL) && !strcasecmp(p, "application/x-dmap-tagged")) { struct metadata_s metadata; dmap_settings settings = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, on_dmap_string, NULL, @@ -651,6 +649,10 @@ static bool handle_rtsp(raop_ctx_t *ctx, int sock) success = ctx->cmd_cb(RAOP_METADATA, metadata.artist, metadata.album, metadata.title); free_metadata(&metadata); } + } else { + char *dump = kd_dump(headers); + LOG_INFO("Unhandled SET PARAMETER\n%s", dump); + free(dump); } }