diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-03-23 12:09:25 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-03-23 12:09:25 +0100 |
commit | a128502221352a82e23c5b143619917c76892669 (patch) | |
tree | be28a68a8b1a648f9c4dc4fc77996dabac1a7afa /ext/opus | |
parent | c2f38cd0547c54018e819291c4877183113ddafc (diff) | |
download | gstreamer-plugins-bad-a128502221352a82e23c5b143619917c76892669.tar.gz |
opusdec: Take channels and sample rate from the caps if we have no stream header
Diffstat (limited to 'ext/opus')
-rw-r--r-- | ext/opus/gstopusdec.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/opus/gstopusdec.c b/ext/opus/gstopusdec.c index 7cffd175b..d3c8e8d9c 100644 --- a/ext/opus/gstopusdec.c +++ b/ext/opus/gstopusdec.c @@ -582,6 +582,22 @@ gst_opus_dec_set_format (GstAudioDecoder * bdec, GstCaps * caps) goto done; gst_buffer_replace (&dec->vorbiscomment, buf); } + } else { + /* defaults if not in the caps */ + dec->n_channels = 2; + dec->sample_rate = 48000; + + gst_structure_get_int (s, "channels", &dec->n_channels); + gst_structure_get_int (s, "rate", &dec->sample_rate); + + /* default stereo mapping */ + dec->channel_mapping_family = 0; + dec->channel_mapping[0] = 0; + dec->channel_mapping[1] = 1; + dec->n_streams = 1; + dec->n_stereo_streams = 1; + + gst_opus_dec_negotiate (dec, NULL); } done: |