audioaggregator: fix filtered getcaps
authorMathieu Duponchelle <mathieu@centricular.com>
Mon, 23 Apr 2018 14:32:41 +0000 (16:32 +0200)
committerMathieu Duponchelle <mathieu@centricular.com>
Mon, 23 Apr 2018 15:13:22 +0000 (17:13 +0200)
commit83939c81e7edb1c10727ce1ae0ece20aee972394
tree72cf59dba60649792f8fc267629c9934707d44ee
parentcc3942e6733b080e94c8cb7f5fb398e1f3513edd
audioaggregator: fix filtered getcaps

In the situation described in
https://bugzilla.gnome.org/show_bug.cgi?id=795397,

downstream_caps consists of two structures, the first with
the preferred rate, if at all possible (44100), the second
containing the full range of allowed rates, as audioresample
correctly tries to negotiate passthrough caps.

As audioaggregator cannot perform rate conversion, it wants
to return a fixated rate in its getcaps implementation,
however it previously directly used the first structure in
the caps allowed downstream, without taking the filter into
consideration, to determine the rate to fixate to.

With this, we first intersect our downstream caps with the
filter, in order not to fixate to an unsupported rate.
gst-libs/gst/audio/gstaudioaggregator.c