diff options
author | Max Kellermann <max@duempel.org> | 2009-01-03 23:29:45 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-03 23:29:45 +0100 |
commit | 700bd44fdaaa0b3ebc6924180daae8f5105d0cd8 (patch) | |
tree | 88455844f452f7b49fac139d39a823e7e5b8ffa0 /src/decoder_thread.c | |
parent | 4be479d20c2f81fb0303106b7080af93b3c456c6 (diff) | |
download | mpd-700bd44fdaaa0b3ebc6924180daae8f5105d0cd8.tar.gz mpd-700bd44fdaaa0b3ebc6924180daae8f5105d0cd8.tar.xz mpd-700bd44fdaaa0b3ebc6924180daae8f5105d0cd8.zip |
input_stream: added tag() method
The tag() method reads a tag from the stream. This replaces the
meta_name and meta_title attributes.
Diffstat (limited to 'src/decoder_thread.c')
-rw-r--r-- | src/decoder_thread.c | 15 |
1 files changed, 12 insertions, 3 deletions
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; } |