aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_api.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-04-13 19:25:53 +0200
committerMax Kellermann <max@duempel.org>2009-04-13 19:25:53 +0200
commit200be2637171a52fce9f23a858dc1c4476fcb7a3 (patch)
treeb5217a3087d5657e0a50930bcf9941785be1268b /src/decoder_api.c
parent99a88988d57d5da5888eb1b82479a8600be6df2f (diff)
downloadmpd-200be2637171a52fce9f23a858dc1c4476fcb7a3.tar.gz
mpd-200be2637171a52fce9f23a858dc1c4476fcb7a3.tar.xz
mpd-200be2637171a52fce9f23a858dc1c4476fcb7a3.zip
decoder_api: submit the song tag to the music pipe
When a new song starts playing, send its tag (song->tag) to the music pipe. This allows output plugins to render tags for all songs, not only those with embedded tags understood by the decoder plugin.
Diffstat (limited to 'src/decoder_api.c')
-rw-r--r--src/decoder_api.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index 93e4790c9..c777084c8 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -189,12 +189,18 @@ update_stream_tag(struct decoder *decoder, struct input_stream *is)
{
struct tag *tag;
- if (is == NULL)
- return false;
-
- tag = input_stream_tag(is);
- if (tag == NULL)
- return false;
+ tag = is != NULL
+ ? input_stream_tag(is)
+ : NULL;
+ if (tag == NULL) {
+ tag = decoder->song_tag;
+ if (tag == NULL)
+ return false;
+
+ /* no stream tag present - submit the song tag
+ instead */
+ decoder->song_tag = NULL;
+ }
if (decoder->stream_tag != NULL)
tag_free(decoder->stream_tag);