diff options
author | Max Kellermann <max@duempel.org> | 2009-05-05 22:41:36 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-05-05 22:41:36 +0200 |
commit | 9080797025d73eb32ce0c7041a0d365015b51f41 (patch) | |
tree | cb04458bb336a255468ab465844645eaf862c57b /src/output/httpd_client.c | |
parent | ebc1d3516c0334a093d8426e52402febb3dd6b00 (diff) | |
download | mpd-9080797025d73eb32ce0c7041a0d365015b51f41.tar.gz mpd-9080797025d73eb32ce0c7041a0d365015b51f41.tar.xz mpd-9080797025d73eb32ce0c7041a0d365015b51f41.zip |
httpd_output: disable Icy-Metadata when encoder supports tags
There's no reason to send both encoder tags and Icy-Metadata to the
client. Let's disable Icy-Metadata when the encoder supports embedded
tags.
Diffstat (limited to '')
-rw-r--r-- | src/output/httpd_client.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/output/httpd_client.c b/src/output/httpd_client.c index 1f1b6affe..52a398e3b 100644 --- a/src/output/httpd_client.c +++ b/src/output/httpd_client.c @@ -90,6 +90,12 @@ struct httpd_client { /* ICY */ /** + * Do we support sending Icy-Metadata to the client? This is + * disabled if the httpd audio output uses encoder tags. + */ + bool metadata_supported; + + /** * If we should sent icy metadata. */ bool metadata_requested; @@ -210,7 +216,8 @@ httpd_client_handle_line(struct httpd_client *client, const char *line) if (g_ascii_strncasecmp(line, "Icy-MetaData: 1", 15) == 0) { /* Send icy metadata */ - client->metadata_requested = true; + client->metadata_requested = + client->metadata_supported; return true; } @@ -417,7 +424,7 @@ httpd_client_in_event(G_GNUC_UNUSED GIOChannel *source, GIOCondition condition, } struct httpd_client * -httpd_client_new(struct httpd_output *httpd, int fd) +httpd_client_new(struct httpd_output *httpd, int fd, bool metadata_supported) { struct httpd_client *client = g_new(struct httpd_client, 1); @@ -443,6 +450,7 @@ httpd_client_new(struct httpd_output *httpd, int fd) client->input = fifo_buffer_new(4096); client->state = REQUEST; + client->metadata_supported = metadata_supported; client->metadata_requested = false; client->metadata_sent = true; client->metaint = 8192; /*TODO: just a std value */ |