From d82547acd3173316a741733c7f946eabf29b7bc6 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Wed, 24 Sep 2014 22:34:08 +0200
Subject: [PATCH] decoder/flac: pass VorbisComment to flac_parse_replay_gain()

---
 src/decoder/plugins/FlacCommon.cxx   | 2 +-
 src/decoder/plugins/FlacMetadata.cxx | 5 +----
 src/decoder/plugins/FlacMetadata.hxx | 2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/decoder/plugins/FlacCommon.cxx b/src/decoder/plugins/FlacCommon.cxx
index 76762bdf9..74eaf4909 100644
--- a/src/decoder/plugins/FlacCommon.cxx
+++ b/src/decoder/plugins/FlacCommon.cxx
@@ -98,7 +98,7 @@ void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
 		break;
 
 	case FLAC__METADATA_TYPE_VORBIS_COMMENT:
-		if (flac_parse_replay_gain(rgi, block))
+		if (flac_parse_replay_gain(rgi, block->data.vorbis_comment))
 			decoder_replay_gain(data->decoder, &rgi);
 
 		decoder_mixramp(data->decoder, flac_parse_mixramp(block));
diff --git a/src/decoder/plugins/FlacMetadata.cxx b/src/decoder/plugins/FlacMetadata.cxx
index 2c3c496a6..4628ad4a2 100644
--- a/src/decoder/plugins/FlacMetadata.cxx
+++ b/src/decoder/plugins/FlacMetadata.cxx
@@ -55,11 +55,8 @@ vorbis_comment_value(const FLAC__StreamMetadata *block,
 
 bool
 flac_parse_replay_gain(ReplayGainInfo &rgi,
-		       const FLAC__StreamMetadata *block)
+		       const FLAC__StreamMetadata_VorbisComment &vc)
 {
-	const FLAC__StreamMetadata_VorbisComment &vc =
-		block->data.vorbis_comment;
-
 	rgi.Clear();
 
 	bool found = false;
diff --git a/src/decoder/plugins/FlacMetadata.hxx b/src/decoder/plugins/FlacMetadata.hxx
index 16af8bd02..f9c3d0840 100644
--- a/src/decoder/plugins/FlacMetadata.hxx
+++ b/src/decoder/plugins/FlacMetadata.hxx
@@ -116,7 +116,7 @@ struct ReplayGainInfo;
 
 bool
 flac_parse_replay_gain(ReplayGainInfo &rgi,
-		       const FLAC__StreamMetadata *block);
+		       const FLAC__StreamMetadata_VorbisComment &vc);
 
 MixRampInfo
 flac_parse_mixramp(const FLAC__StreamMetadata *block);