mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-25 22:55:56 -05:00
[input/file_http] Use swap_pointers to transfer ownership of metadata
This commit is contained in:
parent
67d0504700
commit
ea874154b2
@ -25,6 +25,7 @@
|
||||
|
||||
#include "transcode.h"
|
||||
#include "http.h"
|
||||
#include "misc.h"
|
||||
#include "input.h"
|
||||
|
||||
static int
|
||||
@ -120,16 +121,12 @@ metadata_get_http(struct input_metadata *metadata, struct player_source *ps)
|
||||
}
|
||||
|
||||
if (m->artist)
|
||||
metadata->artist = m->artist;
|
||||
swap_pointers(&metadata->artist, &m->artist);
|
||||
// Note we map title to album, because clients should show stream name as titel
|
||||
if (m->title)
|
||||
metadata->album = m->title;
|
||||
swap_pointers(&metadata->album, &m->title);
|
||||
if (m->artwork_url)
|
||||
metadata->artwork_url = m->artwork_url;
|
||||
|
||||
m->artist = NULL;
|
||||
m->title = NULL;
|
||||
m->artwork_url = NULL;
|
||||
swap_pointers(&metadata->artwork_url, &m->artwork_url);
|
||||
|
||||
http_icy_metadata_free(m, 0);
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user