diff options
author | Max Kellermann <max@duempel.org> | 2008-11-21 20:27:30 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-21 20:27:30 +0100 |
commit | 976d5045c671700b1e16ed2b98e746a67fa91e8b (patch) | |
tree | 06acf6433adcaf822c212be15a099ff40c62eb04 /src/decoder/flac_plugin.c | |
parent | be9e60d55ef191b5b50a9d1eb2337a6b1199c8d4 (diff) | |
download | mpd-976d5045c671700b1e16ed2b98e746a67fa91e8b.tar.gz mpd-976d5045c671700b1e16ed2b98e746a67fa91e8b.tar.xz mpd-976d5045c671700b1e16ed2b98e746a67fa91e8b.zip |
decoder: check audio_format_valid() in all decoders
Refuse to play audio formats which are not supported by MPD.
Diffstat (limited to 'src/decoder/flac_plugin.c')
-rw-r--r-- | src/decoder/flac_plugin.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/decoder/flac_plugin.c b/src/decoder/flac_plugin.c index 4767e35b0..09757f091 100644 --- a/src/decoder/flac_plugin.c +++ b/src/decoder/flac_plugin.c @@ -343,6 +343,14 @@ flac_decode_internal(struct decoder * decoder, struct input_stream *inStream, 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(decoder, &data.audio_format, inStream->seekable, data.total_time); |