mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +00:00
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.
This commit is contained in:
parent
4d5d7bf1c0
commit
bced52d2e8
1 changed files with 2 additions and 3 deletions
|
@ -719,7 +719,6 @@ gst_audio_aggregator_sink_getcaps (GstPad * pad, GstAggregator * agg,
|
||||||
GstCaps *downstream_caps = gst_pad_get_allowed_caps (agg->srcpad);
|
GstCaps *downstream_caps = gst_pad_get_allowed_caps (agg->srcpad);
|
||||||
GstCaps *sink_caps;
|
GstCaps *sink_caps;
|
||||||
GstStructure *s, *s2;
|
GstStructure *s, *s2;
|
||||||
gint downstream_rate;
|
|
||||||
|
|
||||||
sink_template_caps = gst_caps_make_writable (sink_template_caps);
|
sink_template_caps = gst_caps_make_writable (sink_template_caps);
|
||||||
s = gst_caps_get_structure (sink_template_caps, 0);
|
s = gst_caps_get_structure (sink_template_caps, 0);
|
||||||
|
@ -741,8 +740,8 @@ gst_audio_aggregator_sink_getcaps (GstPad * pad, GstAggregator * agg,
|
||||||
else
|
else
|
||||||
s2 = NULL;
|
s2 = NULL;
|
||||||
|
|
||||||
if (s2 && gst_structure_get_int (s2, "rate", &downstream_rate)) {
|
if (s2 && gst_structure_has_field (s2, "rate")) {
|
||||||
gst_structure_fixate_field_nearest_int (s, "rate", downstream_rate);
|
gst_structure_set_value (s, "rate", gst_structure_get_value (s2, "rate"));
|
||||||
} else if (first_configured_pad) {
|
} else if (first_configured_pad) {
|
||||||
gst_structure_fixate_field_nearest_int (s, "rate",
|
gst_structure_fixate_field_nearest_int (s, "rate",
|
||||||
first_configured_pad->info.rate);
|
first_configured_pad->info.rate);
|
||||||
|
|
Loading…
Reference in a new issue