diff options
author | Max Kellermann <max@duempel.org> | 2010-01-05 21:46:12 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-01-06 09:50:34 +0100 |
commit | 550c9319e9f6e68a7f7cc72054de657e6e921072 (patch) | |
tree | 017e991cf5065ef62e08fbf2ecde05b774e78602 /src/decoder/_flac_common.h | |
parent | ae9c02b3a854cd8520eee696cdd68d0b0c32923f (diff) | |
download | mpd-550c9319e9f6e68a7f7cc72054de657e6e921072.tar.gz mpd-550c9319e9f6e68a7f7cc72054de657e6e921072.tar.xz mpd-550c9319e9f6e68a7f7cc72054de657e6e921072.zip |
decoder/flac: moved decoder initialization to _flac_common.c
Invoke decoder_initialized() in the libFLAC metadata callback. This
merges code from the FLAC and the OggFLAC decoder plugin into the
common library.
Diffstat (limited to '')
-rw-r--r-- | src/decoder/_flac_common.h | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/decoder/_flac_common.h b/src/decoder/_flac_common.h index d67a5a9e9..5c59ee123 100644 --- a/src/decoder/_flac_common.h +++ b/src/decoder/_flac_common.h @@ -44,9 +44,9 @@ struct flac_data { unsigned frame_size; /** - * Is the #stream_info member valid? + * Has decoder_initialized() been called yet? */ - bool have_stream_info; + bool initialized; /** * Does the FLAC file contain an unsupported audio format? @@ -55,12 +55,14 @@ struct flac_data { /** * The validated audio format of the FLAC file. This - * attribute is defined if "have_stream_info" is true. + * attribute is defined if "initialized" is true. */ struct audio_format audio_format; /** - * The total number of frames in this song. + * The total number of frames in this song. The decoder + * plugin may initialize this attribute to override the value + * provided by libFLAC (e.g. for sub songs from a CUE sheet). */ FLAC__uint64 total_frames; @@ -89,17 +91,6 @@ 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); |