decoder: check audio_format_valid() in all decoders

Refuse to play audio formats which are not supported by MPD.
This commit is contained in:
Max Kellermann
2008-11-21 20:27:30 +01:00
parent be9e60d55e
commit 976d5045c6
10 changed files with 71 additions and 7 deletions

View File

@@ -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);