aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder/_flac_common.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-11 20:34:59 +0100
committerMax Kellermann <max@duempel.org>2009-11-11 20:44:21 +0100
commit37181c91815d6807df77d6920973b924dba05f1f (patch)
treed3178e76d8ab9379ce615c5e92729592e605f11a /src/decoder/_flac_common.h
parent08b139f37c891b9b5f43f12910efda439add3f5b (diff)
downloadmpd-37181c91815d6807df77d6920973b924dba05f1f.tar.gz
mpd-37181c91815d6807df77d6920973b924dba05f1f.tar.xz
mpd-37181c91815d6807df77d6920973b924dba05f1f.zip
decoder/flac: moved code to flac_data_get_audio_format()
Remove the audio_format attribute, add "frame_size" instead. The audio_format initialization and check is moved both to flac_data_get_audio_format().
Diffstat (limited to '')
-rw-r--r--src/decoder/_flac_common.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/decoder/_flac_common.h b/src/decoder/_flac_common.h
index 84b66285f..1d211fcfb 100644
--- a/src/decoder/_flac_common.h
+++ b/src/decoder/_flac_common.h
@@ -39,6 +39,11 @@ struct flac_data {
struct pcm_buffer buffer;
/**
+ * The size of one frame in the output buffer.
+ */
+ unsigned frame_size;
+
+ /**
* Is the #stream_info member valid?
*/
bool have_stream_info;
@@ -62,7 +67,6 @@ struct flac_data {
*/
FLAC__uint64 next_frame;
- struct audio_format audio_format;
FLAC__uint64 position;
struct decoder *decoder;
struct input_stream *input_stream;
@@ -78,6 +82,17 @@ flac_data_init(struct flac_data *data, struct decoder * decoder,
void
flac_data_deinit(struct flac_data *data);
+/**
+ * Obtains the audio format from the stream_info attribute, and copies
+ * it to the specified #audio_format object. This also updates the
+ * frame_size attribute.
+ *
+ * @return true on success, false the audio format is not supported
+ */
+bool
+flac_data_get_audio_format(struct flac_data *data,
+ struct audio_format *audio_format);
+
void flac_metadata_common_cb(const FLAC__StreamMetadata * block,
struct flac_data *data);