aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-09-25 23:28:53 +0200
committerMax Kellermann <max@duempel.org>2012-09-25 23:31:07 +0200
commit9cdbde4f5e421b7a1ca28d5268d5c31de9d6ad5d (patch)
tree2daa30a0e8301dae5bb15d6fac068b2099058b2f
parentf9147a0706872841acd1b0c97224ab9e06dcecc7 (diff)
output: new option "tags" may be used to disable sending tags
Implements Mantis ticket 0003340.
-rw-r--r--NEWS2
-rw-r--r--doc/user.xml12
-rw-r--r--src/output_init.c1
-rw-r--r--src/output_internal.h7
-rw-r--r--src/output_thread.c2
5 files changed, 23 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index ac243b87..ea52ac16 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ ver 0.18 (2012/??/??)
- adplug: new decoder plugin using libadplug
- opus: new decoder plugin for the Opus codec
- vorbis: skip 16 bit quantisation, provide float samples
+* output:
+ - new option "tags" may be used to disable sending tags to output
* improved decoder/output error reporting
ver 0.17.2 (2012/??/??)
diff --git a/doc/user.xml b/doc/user.xml
index 65b7cb10..c83c625a 100644
--- a/doc/user.xml
+++ b/doc/user.xml
@@ -438,6 +438,18 @@ systemctl start mpd.socket</programlisting>
</row>
<row>
<entry>
+ <varname>tags</varname>
+ <parameter>yes|no</parameter>
+ </entry>
+ <entry>
+ If set to "no", then MPD will not send tags to this
+ output. This is only useful for output plugins that
+ can receive tags, for example the
+ <varname>httpd</varname> output plugin.
+ </entry>
+ </row>
+ <row>
+ <entry>
<varname>always_on</varname>
<parameter>yes|no</parameter>
</entry>
diff --git a/src/output_init.c b/src/output_init.c
index c3b808e9..a6d19192 100644
--- a/src/output_init.c
+++ b/src/output_init.c
@@ -165,6 +165,7 @@ ao_base_init(struct audio_output *ao,
}
ao->plugin = plugin;
+ ao->tags = config_get_block_bool(param, "tags", true);
ao->always_on = config_get_block_bool(param, "always_on", false);
ao->enabled = config_get_block_bool(param, "enabled", true);
ao->really_enabled = false;
diff --git a/src/output_internal.h b/src/output_internal.h
index 9d975d78..1a3e8aa1 100644
--- a/src/output_internal.h
+++ b/src/output_internal.h
@@ -73,6 +73,13 @@ struct audio_output {
struct mixer *mixer;
/**
+ * Will this output receive tags from the decoder? The
+ * default is true, but it may be configured to false to
+ * suppress sending tags to the output.
+ */
+ bool tags;
+
+ /**
* Shall this output always play something (i.e. silence),
* even when playback is stopped?
*/
diff --git a/src/output_thread.c b/src/output_thread.c
index ee9c8a6e..cd1a8a87 100644
--- a/src/output_thread.c
+++ b/src/output_thread.c
@@ -435,7 +435,7 @@ ao_play_chunk(struct audio_output *ao, const struct music_chunk *chunk)
assert(ao != NULL);
assert(ao->filter != NULL);
- if (gcc_unlikely(chunk->tag != NULL)) {
+ if (ao->tags && gcc_unlikely(chunk->tag != NULL)) {
g_mutex_unlock(ao->mutex);
ao_plugin_send_tag(ao, chunk->tag);
g_mutex_lock(ao->mutex);