aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-08 19:42:04 +0100
committerMax Kellermann <max@duempel.org>2014-01-08 19:49:08 +0100
commitbc23a6bb05705d5551117528dfcbfcfedfee4c90 (patch)
tree2283d2440ffa1bf6313c41ecaa59808032390769 /src/decoder
parentac1983eae32caa7c6f10ec4bab32a9657bdb2668 (diff)
downloadmpd-bc23a6bb05705d5551117528dfcbfcfedfee4c90.tar.gz
mpd-bc23a6bb05705d5551117528dfcbfcfedfee4c90.tar.xz
mpd-bc23a6bb05705d5551117528dfcbfcfedfee4c90.zip
tag/TagBuilder: overload Commit() returning a Tag object
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/FlacCommon.cxx4
-rw-r--r--src/decoder/FlacMetadata.cxx8
-rw-r--r--src/decoder/FlacMetadata.hxx5
-rw-r--r--src/decoder/OpusDecoderPlugin.cxx3
4 files changed, 9 insertions, 11 deletions
diff --git a/src/decoder/FlacCommon.cxx b/src/decoder/FlacCommon.cxx
index e355f285a..b0921056a 100644
--- a/src/decoder/FlacCommon.cxx
+++ b/src/decoder/FlacCommon.cxx
@@ -103,8 +103,8 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
decoder_mixramp(data->decoder, flac_parse_mixramp(block));
- flac_vorbis_comments_to_tag(data->tag,
- &block->data.vorbis_comment);
+ data->tag = flac_vorbis_comments_to_tag(&block->data.vorbis_comment);
+ break;
default:
break;
diff --git a/src/decoder/FlacMetadata.cxx b/src/decoder/FlacMetadata.cxx
index f5aef7309..96dbf2db0 100644
--- a/src/decoder/FlacMetadata.cxx
+++ b/src/decoder/FlacMetadata.cxx
@@ -24,6 +24,7 @@
#include "tag/TagHandler.hxx"
#include "tag/TagTable.hxx"
#include "tag/TagBuilder.hxx"
+#include "tag/Tag.hxx"
#include "ReplayGainInfo.hxx"
#include "util/ASCII.hxx"
#include "util/SplitString.hxx"
@@ -199,13 +200,12 @@ flac_scan_metadata(const FLAC__StreamMetadata *block,
}
}
-void
-flac_vorbis_comments_to_tag(Tag &tag,
- const FLAC__StreamMetadata_VorbisComment *comment)
+Tag
+flac_vorbis_comments_to_tag(const FLAC__StreamMetadata_VorbisComment *comment)
{
TagBuilder tag_builder;
flac_scan_comments(comment, &add_tag_handler, &tag_builder);
- tag_builder.Commit(tag);
+ return tag_builder.Commit();
}
void
diff --git a/src/decoder/FlacMetadata.hxx b/src/decoder/FlacMetadata.hxx
index 137101a65..33ef17e72 100644
--- a/src/decoder/FlacMetadata.hxx
+++ b/src/decoder/FlacMetadata.hxx
@@ -130,9 +130,8 @@ flac_parse_replay_gain(ReplayGainInfo &rgi,
MixRampInfo
flac_parse_mixramp(const FLAC__StreamMetadata *block);
-void
-flac_vorbis_comments_to_tag(Tag &tag,
- const FLAC__StreamMetadata_VorbisComment *comment);
+Tag
+flac_vorbis_comments_to_tag(const FLAC__StreamMetadata_VorbisComment *comment);
void
flac_scan_metadata(const FLAC__StreamMetadata *block,
diff --git a/src/decoder/OpusDecoderPlugin.cxx b/src/decoder/OpusDecoderPlugin.cxx
index 201d61d96..04f549f4f 100644
--- a/src/decoder/OpusDecoderPlugin.cxx
+++ b/src/decoder/OpusDecoderPlugin.cxx
@@ -292,8 +292,7 @@ MPDOpusDecoder::HandleTags(const ogg_packet &packet)
!tag_builder.IsEmpty()) {
decoder_replay_gain(decoder, &rgi);
- Tag tag;
- tag_builder.Commit(tag);
+ Tag tag = tag_builder.Commit();
cmd = decoder_tag(decoder, input_stream, std::move(tag));
} else
cmd = decoder_get_command(decoder);