From 200be2637171a52fce9f23a858dc1c4476fcb7a3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 13 Apr 2009 19:25:53 +0200 Subject: 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. --- src/decoder_thread.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/decoder_thread.c') diff --git a/src/decoder_thread.c b/src/decoder_thread.c index dee16218a..c649f3a34 100644 --- a/src/decoder_thread.c +++ b/src/decoder_thread.c @@ -95,6 +95,8 @@ static void decoder_run_song(const struct song *song, const char *uri) } decoder.seeking = false; + decoder.song_tag = song->tag != NULL && song_is_file(song) + ? tag_dup(song->tag) : NULL; decoder.stream_tag = NULL; decoder.decoder_tag = NULL; decoder.chunk = NULL; @@ -201,6 +203,9 @@ static void decoder_run_song(const struct song *song, const char *uri) if (close_instream) input_stream_close(&input_stream); + if (decoder.song_tag != NULL) + tag_free(decoder.song_tag); + if (decoder.stream_tag != NULL) tag_free(decoder.stream_tag); -- cgit v1.2.3