mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-04 17:52:29 +00:00
streamsplitter: Fix getcaps src pad caps merge
Caps returned from gst_pad_peer_get_caps_reffed () may not be writable. If they are not is should cause an assertion in gst_caps_merge (), however, sometimes assertions are disabled in binary builds of -base and it's safer to just be sure the caps are writable. Also, check that the reffed caps pointer is not NULL.
This commit is contained in:
parent
f3e65f1c93
commit
dc79c42484
1 changed files with 6 additions and 3 deletions
|
@ -268,10 +268,13 @@ resync:
|
||||||
GstPad *srcpad = (GstPad *) tmp->data;
|
GstPad *srcpad = (GstPad *) tmp->data;
|
||||||
|
|
||||||
STREAMS_UNLOCK (stream_splitter);
|
STREAMS_UNLOCK (stream_splitter);
|
||||||
if (res)
|
if (res) {
|
||||||
gst_caps_merge (res, gst_pad_peer_get_caps_reffed (srcpad));
|
GstCaps *peercaps = gst_pad_peer_get_caps_reffed (srcpad);
|
||||||
else
|
if (peercaps)
|
||||||
|
gst_caps_merge (res, gst_caps_make_writable (peercaps));
|
||||||
|
} else {
|
||||||
res = gst_pad_peer_get_caps (srcpad);
|
res = gst_pad_peer_get_caps (srcpad);
|
||||||
|
}
|
||||||
STREAMS_LOCK (stream_splitter);
|
STREAMS_LOCK (stream_splitter);
|
||||||
|
|
||||||
if (G_UNLIKELY (cookie != stream_splitter->cookie)) {
|
if (G_UNLIKELY (cookie != stream_splitter->cookie)) {
|
||||||
|
|
Loading…
Reference in a new issue