diff options
author | Max Kellermann <max@duempel.org> | 2009-11-11 20:34:59 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-11-11 20:44:21 +0100 |
commit | 37181c91815d6807df77d6920973b924dba05f1f (patch) | |
tree | d3178e76d8ab9379ce615c5e92729592e605f11a /src/decoder/oggflac_plugin.c | |
parent | 08b139f37c891b9b5f43f12910efda439add3f5b (diff) | |
download | mpd-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 'src/decoder/oggflac_plugin.c')
-rw-r--r-- | src/decoder/oggflac_plugin.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/decoder/oggflac_plugin.c b/src/decoder/oggflac_plugin.c index 14b832bdb..3b6987c6d 100644 --- a/src/decoder/oggflac_plugin.c +++ b/src/decoder/oggflac_plugin.c @@ -288,6 +288,7 @@ oggflac_decode(struct decoder * mpd_decoder, struct input_stream *input_stream) { OggFLAC__SeekableStreamDecoder *decoder = NULL; struct flac_data data; + struct audio_format audio_format; if (ogg_stream_type_detect(input_stream) != FLAC) return; @@ -302,20 +303,10 @@ oggflac_decode(struct decoder * mpd_decoder, struct input_stream *input_stream) goto fail; } - if (!data.have_stream_info) { - g_warning("no STREAMINFO packet found"); + if (!flac_data_get_audio_format(&data, &audio_format)) goto fail; - } - - if (!audio_format_valid(&data.audio_format)) { - g_warning("Invalid audio format: %u:%u:%u\n", - data.audio_format.sample_rate, - data.audio_format.bits, - data.audio_format.channels); - goto fail; - } - decoder_initialized(mpd_decoder, &data.audio_format, + decoder_initialized(mpd_decoder, &audio_format, input_stream->seekable, (float)data.stream_info.total_samples / (float)data.stream_info.sample_rate); |