Correcting annoying AirPlay bug! - release

This commit is contained in:
philippe44
2020-03-01 00:25:09 -08:00
parent 9759c0dbef
commit 0bf2c11fdb
2 changed files with 8 additions and 6 deletions

View File

@@ -631,11 +631,9 @@ static bool handle_rtsp(raop_ctx_t *ctx, int sock)
success = ctx->cmd_cb(RAOP_VOLUME, volume);
} else if (body && (p = strcasestr(body, "progress")) != NULL) {
int start, current, stop = 0;
// we want ms, not s
sscanf(p, "%*[^:]:%u/%u/%u", &start, &current, &stop);
current = ((current - start) / 44100) * 1000;
if (stop) stop = ((stop - start) / 44100) * 1000;
// we want ms, not s
sscanf(p, "%*[^:]:%u/%u/%u", &start, &current, &stop);
current = ((current - start) / 44100) * 1000;
if (stop) stop = ((stop - start) / 44100) * 1000;
else stop = -1;
@@ -651,6 +649,10 @@ static bool handle_rtsp(raop_ctx_t *ctx, int sock)
LOG_INFO("[%p]: received metadata");
settings.ctx = &metadata;
memset(&metadata, 0, sizeof(struct metadata_s));
if (!dmap_parse(&settings, body, len)) {
LOG_INFO("[%p]: received metadata\n\tartist: %s\n\talbum: %s\n\ttitle: %s",
ctx, metadata.artist, metadata.album, metadata.title);
success = ctx->cmd_cb(RAOP_METADATA, metadata.artist, metadata.album, metadata.title);
free_metadata(&metadata);
}
} else {