summaryrefslogtreecommitdiff
path: root/ext/opus
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-06-04 11:54:24 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-06-04 11:54:24 +0200
commit0ea7a89c1429507f29a761da34bbde56307eea6c (patch)
treedaf9abb0239747191ba71b67b0753f32746ad614 /ext/opus
parentcecb83e590714c376253dad1d769b3a78162daea (diff)
downloadgstreamer-plugins-base-0ea7a89c1429507f29a761da34bbde56307eea6c.tar.gz
opusdec: If channel/rate negotiation fails, fall back to stereo and 48kHz
Diffstat (limited to 'ext/opus')
-rw-r--r--ext/opus/gstopusdec.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/opus/gstopusdec.c b/ext/opus/gstopusdec.c
index bd9847b0e..c88b9eedd 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);