From 719990b1c5db93ccdc21e5f91e98ed9e8540ade1 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 10 Nov 2009 19:01:38 +0100 Subject: decoder: use audio_format_init_checked() Let the audio_check library verify the audio format in all (relevant, i.e. non-hardcoded) plugins. --- src/decoder/vorbis_plugin.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/decoder/vorbis_plugin.c') 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; } -- cgit v1.2.3