From 7f9402bd22f02a46b32d53560094622493f33f37 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 31 Jul 2013 00:26:55 +0200 Subject: Tag: add method Clear() Allow reusing Tag instances. --- src/decoder/FlacCommon.cxx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/decoder/FlacCommon.cxx') diff --git a/src/decoder/FlacCommon.cxx b/src/decoder/FlacCommon.cxx index 6b6c20d3c..32917ed86 100644 --- a/src/decoder/FlacCommon.cxx +++ b/src/decoder/FlacCommon.cxx @@ -36,16 +36,10 @@ flac_data::flac_data(struct decoder *_decoder, :FlacInput(_input_stream, _decoder), initialized(false), unsupported(false), total_frames(0), first_frame(0), next_frame(0), position(0), - decoder(_decoder), input_stream(_input_stream), - tag(nullptr) + decoder(_decoder), input_stream(_input_stream) { } -flac_data::~flac_data() -{ - delete tag; -} - static enum sample_format flac_sample_format(unsigned bits_per_sample) { @@ -116,9 +110,8 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block, decoder_mixramp(data->decoder, mixramp_start, mixramp_end); - if (data->tag != nullptr) - flac_vorbis_comments_to_tag(data->tag, - &block->data.vorbis_comment); + flac_vorbis_comments_to_tag(data->tag, + &block->data.vorbis_comment); default: break; -- cgit v1.2.3