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.
This commit is contained in:
Max Kellermann
2009-04-13 19:25:53 +02:00
parent 99a88988d5
commit 200be26371
3 changed files with 23 additions and 5 deletions

View File

@@ -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);