audioaggregator: always use downstream's rate requirements
authorMathieu Duponchelle <mathieu@centricular.com>
Mon, 15 Jul 2019 14:08:34 +0000 (16:08 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 10 Aug 2019 20:21:05 +0000 (21:21 +0100)
commit00bd92bdbbcf2bfdfaaeadc4bc73cb3dc539f69e
tree75ed3673643c9b454edb98975ccbe5057e282e60
parented7fb6951fc95e6fdb13478a9fcbd51067659dac
audioaggregator: always use downstream's rate requirements

We were previously only fixating the rate in the getcaps
implementation when downstream was requiring a discrete value,
causing negotiation to fail when upstream was capable of rate
conversion, but not made aware that it had to occur.

Instead of fixating the rate, we can simply update our sink
template caps with whatever GValue the downstream caps are holding
as their rate field.

Allows negotiation to successfully complete with pipelines such as:

audiotestsrc ! audio/x-raw, rate=48000 ! audioresample ! audiomixer name=m ! \
audio/x-raw, rate={800, 1000} ! autoaudiosink \
audiotestsrc ! audio/x-raw, rate=44100 ! audioresample ! m.
gst-libs/gst/audio/gstaudioaggregator.c