From 700bd44fdaaa0b3ebc6924180daae8f5105d0cd8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 3 Jan 2009 23:29:45 +0100 Subject: input_stream: added tag() method The tag() method reads a tag from the stream. This replaces the meta_name and meta_title attributes. --- src/decoder_thread.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/decoder_thread.c') diff --git a/src/decoder_thread.c b/src/decoder_thread.c index 35d6e3206..3baa228e3 100644 --- a/src/decoder_thread.c +++ b/src/decoder_thread.c @@ -38,7 +38,8 @@ decoder_stream_decode(const struct decoder_plugin *plugin, assert(plugin != NULL); assert(plugin->stream_decode != NULL); assert(decoder != NULL); - assert(!decoder->stream_tag_sent); + assert(decoder->stream_tag == NULL); + assert(decoder->decoder_tag == NULL); assert(input_stream != NULL); assert(input_stream->ready); assert(dc.state == DECODE_STATE_START); @@ -61,7 +62,8 @@ decoder_file_decode(const struct decoder_plugin *plugin, assert(plugin != NULL); assert(plugin->file_decode != NULL); assert(decoder != NULL); - assert(!decoder->stream_tag_sent); + assert(decoder->stream_tag == NULL); + assert(decoder->decoder_tag == NULL); assert(path != NULL); assert(path[0] == '/'); assert(dc.state == DECODE_STATE_START); @@ -88,7 +90,8 @@ static void decoder_run_song(const struct song *song, const char *uri) } decoder.seeking = false; - decoder.stream_tag_sent = false; + decoder.stream_tag = NULL; + decoder.decoder_tag = NULL; dc.state = DECODE_STATE_START; dc.command = DECODE_COMMAND_NONE; @@ -186,6 +189,12 @@ static void decoder_run_song(const struct song *song, const char *uri) if (close_instream) input_stream_close(&input_stream); + if (decoder.stream_tag != NULL) + tag_free(decoder.stream_tag); + + if (decoder.decoder_tag != NULL) + tag_free(decoder.decoder_tag); + dc.state = ret ? DECODE_STATE_STOP : DECODE_STATE_ERROR; } -- cgit v1.2.3