aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/mp3_plugin.c46
-rw-r--r--src/decoder/oggvorbis_plugin.c10
2 files changed, 5 insertions, 51 deletions
diff --git a/src/decoder/mp3_plugin.c b/src/decoder/mp3_plugin.c
index 7f742361d..f3edf9d20 100644
--- a/src/decoder/mp3_plugin.c
+++ b/src/decoder/mp3_plugin.c
@@ -942,19 +942,6 @@ mp3_synth_and_send(struct mp3_data *data, ReplayGainInfo *replay_gain_info)
return DECODE_COMMAND_STOP;
}
- if (data->input_stream->meta_title) {
- struct tag *tag = tag_new();
- if (data->input_stream->meta_name) {
- tag_add_item(tag, TAG_ITEM_NAME,
- data->input_stream->meta_name);
- }
- tag_add_item(tag, TAG_ITEM_TITLE,
- data->input_stream->meta_title);
- free(data->input_stream->meta_title);
- data->input_stream->meta_title = NULL;
- tag_free(tag);
- }
-
if (!data->decoded_first_frame) {
i = data->drop_start_samples;
data->decoded_first_frame = true;
@@ -1079,37 +1066,14 @@ mp3_decode(struct decoder *decoder, struct input_stream *input_stream)
mp3_audio_format(&data, &audio_format);
- if (input_stream->meta_title) {
- if (tag)
- tag_free(tag);
- tag = tag_new();
- tag_add_item(tag, TAG_ITEM_TITLE, input_stream->meta_title);
- free(input_stream->meta_title);
- input_stream->meta_title = NULL;
- if (input_stream->meta_name) {
- tag_add_item(tag, TAG_ITEM_NAME,
- input_stream->meta_name);
- }
- tag_free(tag);
- } else if (tag) {
- if (input_stream->meta_name) {
- tag_clear_items_by_type(tag, TAG_ITEM_NAME);
- tag_add_item(tag, TAG_ITEM_NAME,
- input_stream->meta_name);
- }
- tag_free(tag);
- } else if (input_stream->meta_name) {
- tag = tag_new();
- if (input_stream->meta_name) {
- tag_add_item(tag, TAG_ITEM_NAME,
- input_stream->meta_name);
- }
- tag_free(tag);
- }
-
decoder_initialized(decoder, &audio_format,
data.input_stream->seekable, data.total_time);
+ if (tag != NULL) {
+ decoder_tag(decoder, input_stream, tag);
+ tag_free(tag);
+ }
+
while (mp3_read(&data, &replay_gain_info)) ;
if (replay_gain_info)
diff --git a/src/decoder/oggvorbis_plugin.c b/src/decoder/oggvorbis_plugin.c
index d5402aa66..f86bf3fc4 100644
--- a/src/decoder/oggvorbis_plugin.c
+++ b/src/decoder/oggvorbis_plugin.c
@@ -181,23 +181,14 @@ static struct tag *oggCommentsParse(char **comments)
static void putOggCommentsIntoOutputBuffer(struct decoder *decoder,
struct input_stream *is,
- char *streamName,
char **comments)
{
struct tag *tag;
tag = oggCommentsParse(comments);
- if (!tag && streamName) {
- tag = tag_new();
- }
if (!tag)
return;
- if (streamName) {
- tag_clear_items_by_type(tag, TAG_ITEM_NAME);
- tag_add_item(tag, TAG_ITEM_NAME, streamName);
- }
-
decoder_tag(decoder, is, tag);
tag_free(tag);
}
@@ -288,7 +279,6 @@ oggvorbis_decode(struct decoder *decoder, struct input_stream *inStream)
}
comments = ov_comment(&vf, -1)->user_comments;
putOggCommentsIntoOutputBuffer(decoder, inStream,
- inStream->meta_name,
comments);
ogg_getReplayGainInfo(comments, &replayGainInfo);
}