aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/flac_metadata.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2010-02-14 20:36:31 +0100
committerMax Kellermann <max@duempel.org>2010-02-17 07:22:44 +0100
commit5e0117b4441f257fcb1aab48b42a787567ebcbe6 (patch)
tree7233b273814def640145276f1a46d45b8cf274e4 /src/decoder/flac_metadata.h
parentc05e6a1275621421eb0a7c3112b0401fa458841e (diff)
downloadmpd-5e0117b4441f257fcb1aab48b42a787567ebcbe6.tar.gz
mpd-5e0117b4441f257fcb1aab48b42a787567ebcbe6.tar.xz
mpd-5e0117b4441f257fcb1aab48b42a787567ebcbe6.zip
replay_gain_info: allocate the struct statically
Don't allocate each replay_gain_info object on the heap. Those objects who held a pointer now store a full replay_gain_info object. This reduces the number of allocations and heap fragmentation.
Diffstat (limited to 'src/decoder/flac_metadata.h')
-rw-r--r--src/decoder/flac_metadata.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/decoder/flac_metadata.h b/src/decoder/flac_metadata.h
index 5c5c6445e..3cc333617 100644
--- a/src/decoder/flac_metadata.h
+++ b/src/decoder/flac_metadata.h
@@ -20,9 +20,11 @@
#ifndef MPD_FLAC_METADATA_H
#define MPD_FLAC_METADATA_H
+#include <stdbool.h>
#include <FLAC/metadata.h>
struct tag;
+struct replay_gain_info;
static inline unsigned
flac_duration(const FLAC__StreamMetadata_StreamInfo *stream_info)
@@ -31,8 +33,9 @@ flac_duration(const FLAC__StreamMetadata_StreamInfo *stream_info)
stream_info->sample_rate;
}
-struct replay_gain_info *
-flac_parse_replay_gain(const FLAC__StreamMetadata *block);
+bool
+flac_parse_replay_gain(struct replay_gain_info *rgi,
+ const FLAC__StreamMetadata *block);
void
flac_vorbis_comments_to_tag(struct tag *tag, const char *char_tnum,