aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/OpusDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-05 19:11:50 +0200
committerMax Kellermann <max@duempel.org>2013-09-26 17:35:08 +0200
commit52ee132d92d4a04d31bbbdeb7c6c0077bd2a2828 (patch)
tree098cf4f9385693b28e41c5342fcdfae416b058dd /src/decoder/OpusDecoderPlugin.cxx
parent7ca0aedcfc35c784d7ae07cd1f1e8dce684e5901 (diff)
downloadmpd-52ee132d92d4a04d31bbbdeb7c6c0077bd2a2828.tar.gz
mpd-52ee132d92d4a04d31bbbdeb7c6c0077bd2a2828.tar.xz
mpd-52ee132d92d4a04d31bbbdeb7c6c0077bd2a2828.zip
TagHandler: use a TagBuilder internally
Reduce heap allocator overhead.
Diffstat (limited to 'src/decoder/OpusDecoderPlugin.cxx')
-rw-r--r--src/decoder/OpusDecoderPlugin.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/decoder/OpusDecoderPlugin.cxx b/src/decoder/OpusDecoderPlugin.cxx
index 9d852102b..c757d66ef 100644
--- a/src/decoder/OpusDecoderPlugin.cxx
+++ b/src/decoder/OpusDecoderPlugin.cxx
@@ -28,6 +28,7 @@
#include "OggCodec.hxx"
#include "CheckAudioFormat.hxx"
#include "tag/TagHandler.hxx"
+#include "tag/TagBuilder.hxx"
#include "InputStream.hxx"
#include "util/Error.hxx"
@@ -222,14 +223,16 @@ MPDOpusDecoder::HandleBOS(const ogg_packet &packet)
inline enum decoder_command
MPDOpusDecoder::HandleTags(const ogg_packet &packet)
{
- Tag tag;
+ TagBuilder tag_builder;
enum decoder_command cmd;
if (ScanOpusTags(packet.packet, packet.bytes,
- &add_tag_handler, &tag) &&
- !tag.IsEmpty())
+ &add_tag_handler, &tag_builder) &&
+ !tag_builder.IsEmpty()) {
+ Tag tag;
+ tag_builder.Commit(tag);
cmd = decoder_tag(decoder, input_stream, std::move(tag));
- else
+ } else
cmd = decoder_get_command(decoder);
return cmd;