Fixup (select between cur_playing and cur_streaming)

This commit is contained in:
ejurgensen 2015-04-09 22:33:23 +02:00
parent e72447954a
commit 0397b824a5
1 changed files with 12 additions and 3 deletions

View File

@ -2628,13 +2628,22 @@ now_playing(struct player_command *cmd)
static int static int
artwork_url_get(struct player_command *cmd) artwork_url_get(struct player_command *cmd)
{ {
struct player_source *ps;
cmd->arg.icy.artwork_url = NULL; cmd->arg.icy.artwork_url = NULL;
/* Check that we are playing a viable stream, and that it has the requested id */ if (cur_playing)
if (!cur_streaming || cur_streaming->id != cmd->arg.icy.id || cur_streaming->type != SOURCE_HTTP || !cur_streaming->ctx) ps = cur_playing;
else if (cur_streaming)
ps = cur_streaming;
else
return -1; return -1;
transcode_metadata_artwork_url(cur_streaming->ctx, &cmd->arg.icy.artwork_url); /* Check that we are playing a viable stream, and that it has the requested id */
if (!ps->ctx || ps->type != SOURCE_HTTP || ps->id != cmd->arg.icy.id)
return -1;
transcode_metadata_artwork_url(ps->ctx, &cmd->arg.icy.artwork_url);
return 0; return 0;
} }