fix DMAP parsing and a few compiler warning - release

This commit is contained in:
philippe44
2023-08-26 13:16:09 -07:00
parent 888371ef08
commit b5b7dc6ebb
2 changed files with 15 additions and 13 deletions

View File

@@ -185,7 +185,7 @@ struct raop_ctx_s *raop_create(uint32_t host, char *name,
getsockname(ctx->sock, (struct sockaddr *) &addr, &nlen);
ctx->port = ntohs(addr.sin_port);
#endif
ctx->running = true;
memcpy(ctx->mac, mac, 6);
@@ -193,7 +193,7 @@ struct raop_ctx_s *raop_create(uint32_t host, char *name,
#ifdef WIN32
// seems that Windows snprintf does not add NULL char if actual size > max
id[63] = '\0';
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);
@@ -619,12 +619,12 @@ static bool handle_rtsp(raop_ctx_t *ctx, int sock)
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;
struct metadata_s metadata;
dmap_settings settings = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, on_dmap_string, NULL,
NULL
};
settings.ctx = &metadata;
memset(&metadata, 0, sizeof(struct metadata_s));
if (!dmap_parse(&settings, body, len)) {
@@ -873,7 +873,7 @@ static int base64_pad(char *src, char **padded)
memset(*padded, '=', n);
memcpy(*padded, src, strlen(src));
(*padded)[n] = '\0';
return strlen(*padded);
}
@@ -959,7 +959,7 @@ static int base64_decode(const char *str, void *data)
*q++ = (val >> 8) & 0xff;
if (marker < 1)
*q++ = val & 0xff;
}
}
return q - (unsigned char *) data;
}