aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/FlacDecoderPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-07-31 00:26:55 +0200
committerMax Kellermann <max@duempel.org>2013-07-31 00:35:05 +0200
commit7f9402bd22f02a46b32d53560094622493f33f37 (patch)
treeb96b437520be32a512943985035939b9b94e5223 /src/decoder/FlacDecoderPlugin.cxx
parentcbd38327e7f6948647768227ac4836f64e5ccd51 (diff)
downloadmpd-7f9402bd22f02a46b32d53560094622493f33f37.tar.gz
mpd-7f9402bd22f02a46b32d53560094622493f33f37.tar.xz
mpd-7f9402bd22f02a46b32d53560094622493f33f37.zip
Tag: add method Clear()
Allow reusing Tag instances.
Diffstat (limited to 'src/decoder/FlacDecoderPlugin.cxx')
-rw-r--r--src/decoder/FlacDecoderPlugin.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/decoder/FlacDecoderPlugin.cxx b/src/decoder/FlacDecoderPlugin.cxx
index 4140d14f7..fc0925610 100644
--- a/src/decoder/FlacDecoderPlugin.cxx
+++ b/src/decoder/FlacDecoderPlugin.cxx
@@ -172,11 +172,10 @@ flac_decoder_loop(struct flac_data *data, FLAC__StreamDecoder *flac_dec,
data->first_frame = t_start;
while (true) {
- if (data->tag != nullptr && !data->tag->IsEmpty()) {
+ if (!data->tag.IsEmpty()) {
cmd = decoder_tag(data->decoder, data->input_stream,
- std::move(*data->tag));
- delete data->tag;
- data->tag = new Tag();
+ std::move(data->tag));
+ data->tag.Clear();
} else
cmd = decoder_get_command(decoder);
@@ -260,7 +259,6 @@ flac_decode_internal(struct decoder * decoder,
return;
struct flac_data data(decoder, input_stream);
- data.tag = new Tag();
FLAC__StreamDecoderInitStatus status =
stream_init(flac_dec, &data, is_ogg);