diff options
author | Max Kellermann <max@duempel.org> | 2009-11-10 19:01:38 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-11-14 00:47:22 +0100 |
commit | 719990b1c5db93ccdc21e5f91e98ed9e8540ade1 (patch) | |
tree | ef03f58f54767b73c4c8d267e7b0008938863a17 /src/decoder/vorbis_plugin.c | |
parent | f47bb8c1db91b50be95c4d5dd301728e38c57274 (diff) | |
download | mpd-719990b1c5db93ccdc21e5f91e98ed9e8540ade1.tar.gz mpd-719990b1c5db93ccdc21e5f91e98ed9e8540ade1.tar.xz mpd-719990b1c5db93ccdc21e5f91e98ed9e8540ade1.zip |
decoder: use audio_format_init_checked()
Let the audio_check library verify the audio format in all (relevant,
i.e. non-hardcoded) plugins.
Diffstat (limited to '')
-rwxr-xr-x | src/decoder/vorbis_plugin.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/decoder/vorbis_plugin.c b/src/decoder/vorbis_plugin.c index 71d38c3ba..3a41869a0 100755 --- a/src/decoder/vorbis_plugin.c +++ b/src/decoder/vorbis_plugin.c @@ -19,6 +19,7 @@ #include "config.h" #include "_ogg_common.h" +#include "audio_check.h" #include "uri.h" #ifndef HAVE_TREMOR @@ -264,6 +265,7 @@ static void vorbis_stream_decode(struct decoder *decoder, struct input_stream *input_stream) { + GError *error = NULL; OggVorbis_File vf; ov_callbacks callbacks; struct vorbis_decoder_data data; @@ -309,13 +311,10 @@ vorbis_stream_decode(struct decoder *decoder, return; } - audio_format_init(&audio_format, vi->rate, 16, vi->channels); - - 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); + if (!audio_format_init_checked(&audio_format, vi->rate, 16, + vi->channels, &error)) { + g_warning("%s", error->message); + g_error_free(error); return; } |