aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-07-31 00:34:22 +0200
committerMax Kellermann <max@duempel.org>2013-07-31 00:34:22 +0200
commitcbd38327e7f6948647768227ac4836f64e5ccd51 (patch)
tree03510bbcb68e22a76d261089c97a851a0e6596c3 /src/decoder
parent06f898cc1240a29b293de0e97ad95a4fdc971254 (diff)
downloadmpd-cbd38327e7f6948647768227ac4836f64e5ccd51.tar.gz
mpd-cbd38327e7f6948647768227ac4836f64e5ccd51.tar.xz
mpd-cbd38327e7f6948647768227ac4836f64e5ccd51.zip
DecoderAPI: pass rvalue reference to decoder_tag()
Avoid duplicating the tag.
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/FlacDecoderPlugin.cxx2
-rw-r--r--src/decoder/MadDecoderPlugin.cxx5
-rw-r--r--src/decoder/OpusDecoderPlugin.cxx2
-rw-r--r--src/decoder/VorbisDecoderPlugin.cxx2
4 files changed, 6 insertions, 5 deletions
diff --git a/src/decoder/FlacDecoderPlugin.cxx b/src/decoder/FlacDecoderPlugin.cxx
index 3bc50aa4e..4140d14f7 100644
--- a/src/decoder/FlacDecoderPlugin.cxx
+++ b/src/decoder/FlacDecoderPlugin.cxx
@@ -174,7 +174,7 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
while (true) {
if (data->tag != nullptr && !data->tag->IsEmpty()) {
cmd = decoder_tag(data->decoder, data->input_stream,
- data->tag);
+ std::move(*data->tag));
delete data->tag;
data->tag = new Tag();
} else
diff --git a/src/decoder/MadDecoderPlugin.cxx b/src/decoder/MadDecoderPlugin.cxx
index 9f36fd86b..b75e12343 100644
--- a/src/decoder/MadDecoderPlugin.cxx
+++ b/src/decoder/MadDecoderPlugin.cxx
@@ -1084,7 +1084,8 @@ MadDecoder::Read()
ret = DecodeNextFrameHeader(&tag);
if (tag != nullptr) {
- decoder_tag(decoder, input_stream, tag);
+ decoder_tag(decoder, input_stream,
+ std::move(*tag));
delete tag;
}
} while (ret == DECODE_CONT);
@@ -1142,7 +1143,7 @@ mp3_decode(struct decoder *decoder, struct input_stream *input_stream)
data.total_time);
if (tag != nullptr) {
- decoder_tag(decoder, input_stream, tag);
+ decoder_tag(decoder, input_stream, std::move(*tag));
delete tag;
}
diff --git a/src/decoder/OpusDecoderPlugin.cxx b/src/decoder/OpusDecoderPlugin.cxx
index 148125347..08c67b570 100644
--- a/src/decoder/OpusDecoderPlugin.cxx
+++ b/src/decoder/OpusDecoderPlugin.cxx
@@ -228,7 +228,7 @@ MPDOpusDecoder::HandleTags(const ogg_packet &packet)
if (ScanOpusTags(packet.packet, packet.bytes,
&add_tag_handler, &tag) &&
!tag.IsEmpty())
- cmd = decoder_tag(decoder, input_stream, &tag);
+ cmd = decoder_tag(decoder, input_stream, std::move(tag));
else
cmd = decoder_get_command(decoder);
diff --git a/src/decoder/VorbisDecoderPlugin.cxx b/src/decoder/VorbisDecoderPlugin.cxx
index 36b3e3139..68d5a21f0 100644
--- a/src/decoder/VorbisDecoderPlugin.cxx
+++ b/src/decoder/VorbisDecoderPlugin.cxx
@@ -158,7 +158,7 @@ vorbis_send_comments(struct decoder *decoder, struct input_stream *is,
if (!tag)
return;
- decoder_tag(decoder, is, tag);
+ decoder_tag(decoder, is, std::move(*tag));
delete tag;
}