aboutsummaryrefslogtreecommitdiffstats
path: root/src/output
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-05-05 22:36:44 +0200
committerMax Kellermann <max@duempel.org>2009-05-05 22:36:44 +0200
commit795569208a6f81afc35b61312b168aa9225dddfe (patch)
tree15e86c3d362883b86574a0a0a3d8c56993a4774d /src/output
parent7dcdb2ce39654d9975f3264e72cd46e7251ca585 (diff)
downloadmpd-795569208a6f81afc35b61312b168aa9225dddfe.tar.gz
mpd-795569208a6f81afc35b61312b168aa9225dddfe.tar.xz
mpd-795569208a6f81afc35b61312b168aa9225dddfe.zip
httpd_output: assert that tag!=NULL
In the tag() method, MPD guarantees that it does not pass tag==NULL. Converted the runtime check to an assertion.
Diffstat (limited to '')
-rw-r--r--src/output/httpd_output_plugin.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/output/httpd_output_plugin.c b/src/output/httpd_output_plugin.c
index c1f609489..b9befb0d6 100644
--- a/src/output/httpd_output_plugin.c
+++ b/src/output/httpd_output_plugin.c
@@ -378,16 +378,15 @@ httpd_output_tag(void *data, const struct tag *tag)
{
struct httpd_output *httpd = data;
- if (httpd->metadata) {
+ assert(tag != NULL);
+
+ if (httpd->metadata != NULL)
page_unref (httpd->metadata);
- httpd->metadata = NULL;
- }
- if (tag)
- httpd->metadata = icy_server_metadata_page(tag, TAG_ITEM_ALBUM,
- TAG_ITEM_ARTIST,
- TAG_ITEM_TITLE,
- TAG_NUM_OF_ITEM_TYPES);
+ httpd->metadata = icy_server_metadata_page(tag, TAG_ITEM_ALBUM,
+ TAG_ITEM_ARTIST,
+ TAG_ITEM_TITLE,
+ TAG_NUM_OF_ITEM_TYPES);
if (httpd->metadata) {
g_mutex_lock(httpd->mutex);