mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
audioenc/dec: Preserve downstream caps preference in get caps
This should fix pipelines such as this one to work as expected ... ! opusenc ! capsfilter caps='audio/x-opus, channels=1; audio/x-opus, channels=2' ! ... The expectation is that the encoder will propose the first structure before the second one to the source. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3673>
This commit is contained in:
parent
bd534af999
commit
e03a10a0f2
1 changed files with 4 additions and 2 deletions
|
@ -128,13 +128,15 @@ __gst_audio_element_proxy_getcaps (GstElement * element, GstPad * sinkpad,
|
|||
|
||||
filter_caps = __gst_audio_element_proxy_caps (element, templ_caps, allowed);
|
||||
|
||||
fcaps = gst_caps_intersect (filter_caps, templ_caps);
|
||||
fcaps = gst_caps_intersect_full (filter_caps, templ_caps,
|
||||
GST_CAPS_INTERSECT_FIRST);
|
||||
gst_caps_unref (filter_caps);
|
||||
gst_caps_unref (templ_caps);
|
||||
|
||||
if (filter) {
|
||||
GST_LOG_OBJECT (element, "intersecting with %" GST_PTR_FORMAT, filter);
|
||||
filter_caps = gst_caps_intersect (fcaps, filter);
|
||||
filter_caps = gst_caps_intersect_full (fcaps, filter,
|
||||
GST_CAPS_INTERSECT_FIRST);
|
||||
gst_caps_unref (fcaps);
|
||||
fcaps = filter_caps;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue