summaryrefslogtreecommitdiff
path: root/gst/icydemux
diff options
context:
space:
mode:
authorSøren Juul <zpon.dk@gmail.com>2017-02-10 10:53:05 +0100
committerSebastian Dröge <sebastian@centricular.com>2017-02-14 12:24:13 +0200
commit1184429e21f8c48e435625f46e3e9a79a4662498 (patch)
tree8b2faa2bfbd93e6e8ddb5bd16ee1e805fa204141 /gst/icydemux
parent49002fa8a7b6d782788e846de194b4f4c765cea5 (diff)
icydemux: reset tags on empty value
Some radio streams uses StreamTitle='' to reset the title after a track stopped playing, e.g. while the host talks between tracks or during news segments. This change forces an empty tag object to be distributed if StreamTitle or StreamUrl is received with empty value, thus allowing downstream elements to get notified about this. https://bugzilla.gnome.org/show_bug.cgi?id=778437
Diffstat (limited to 'gst/icydemux')
-rw-r--r--gst/icydemux/gsticydemux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/icydemux/gsticydemux.c b/gst/icydemux/gsticydemux.c
index dc0c266ab..12fdad24a 100644
--- a/gst/icydemux/gsticydemux.c
+++ b/gst/icydemux/gsticydemux.c
@@ -323,6 +323,7 @@ gst_icydemux_parse_and_send_tags (GstICYDemux * icydemux)
GstTagList *tags;
const guint8 *data;
int length, i;
+ gboolean tags_found = FALSE;
gchar *buffer;
gchar **strings;
@@ -340,6 +341,7 @@ gst_icydemux_parse_and_send_tags (GstICYDemux * icydemux)
for (i = 0; strings[i]; i++) {
if (!g_ascii_strncasecmp (strings[i], "StreamTitle=", 12)) {
char *title = gst_icydemux_unicodify (strings[i] + 13);
+ tags_found = TRUE;
if (title && *title) {
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_TITLE,
@@ -348,6 +350,7 @@ gst_icydemux_parse_and_send_tags (GstICYDemux * icydemux)
}
} else if (!g_ascii_strncasecmp (strings[i], "StreamUrl=", 10)) {
char *url = gst_icydemux_unicodify (strings[i] + 11);
+ tags_found = TRUE;
if (url && *url) {
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_HOMEPAGE,
@@ -362,7 +365,7 @@ gst_icydemux_parse_and_send_tags (GstICYDemux * icydemux)
gst_adapter_unmap (icydemux->meta_adapter);
gst_adapter_flush (icydemux->meta_adapter, length);
- if (!gst_tag_list_is_empty (tags))
+ if (tags_found)
gst_icydemux_tag_found (icydemux, tags);
else
gst_tag_list_unref (tags);