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/mp4_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 '')
-rw-r--r-- | src/decoder/mp4_plugin.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/decoder/mp4_plugin.c b/src/decoder/mp4_plugin.c index f97ffe50a..67d85ba0b 100644 --- a/src/decoder/mp4_plugin.c +++ b/src/decoder/mp4_plugin.c @@ -275,6 +275,15 @@ mp4_decode(struct decoder *mpd_decoder, struct input_stream *input_stream) scale = frame_info.samplerate; #endif audio_format.sample_rate = scale; + + if (!audio_format_valid(&audio_format)) { + g_warning("Invalid audio format: %u:%u:%u\n", + audio_format.sample_rate, + audio_format.bits, + audio_format.channels); + break; + } + decoder_initialized(mpd_decoder, &audio_format, input_stream->seekable, total_time); |