From 37181c91815d6807df77d6920973b924dba05f1f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 11 Nov 2009 20:34:59 +0100 Subject: 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(). --- src/decoder/_flac_common.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/decoder/_flac_common.h') 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 @@ -38,6 +38,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? */ @@ -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); -- cgit v1.2.3