From 1ba8f82b94ba701d03f90d2f7a26922226b2c59a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 4 Jun 2015 11:54:24 +0200 Subject: [PATCH] opusdec: If channel/rate negotiation fails, fall back to stereo and 48kHz --- ext/opus/gstopusdec.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ext/opus/gstopusdec.c b/ext/opus/gstopusdec.c index bd9847b0ea..c88b9eeddf 100644 --- a/ext/opus/gstopusdec.c +++ b/ext/opus/gstopusdec.c @@ -240,6 +240,17 @@ gst_opus_dec_negotiate (GstOpusDec * dec, const GstAudioChannelPosition * pos) gst_caps_unref (caps); } + if (dec->n_channels == 0) { + GST_DEBUG_OBJECT (dec, "Using a default of 2 channels"); + dec->n_channels = 2; + pos = NULL; + } + + if (dec->sample_rate == 0) { + GST_DEBUG_OBJECT (dec, "Using a default of 48kHz sample rate"); + dec->sample_rate = 48000; + } + GST_INFO_OBJECT (dec, "Negotiated %d channels, %d Hz", dec->n_channels, dec->sample_rate);