mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
mpegtsmux: fix broken pad caps refcount handling
gst_caps_make_writable() takes ownership of the caps passed in, but the caller doesn't own a ref to the caps here, because GST_PAD_CAPS doesn't return a ref. Looks like the code relied on a caps leak elsewhere for this to work properly.
This commit is contained in:
parent
70e71562b7
commit
0276663d0c
1 changed files with 3 additions and 2 deletions
|
@ -946,10 +946,10 @@ mpegtsdemux_set_header_on_caps (MpegTsMux * mux)
|
|||
GstStructure *structure;
|
||||
GValue array = { 0 };
|
||||
GValue value = { 0 };
|
||||
GstCaps *caps = GST_PAD_CAPS (mux->srcpad);
|
||||
GstCaps *caps;
|
||||
GList *sh;
|
||||
|
||||
caps = gst_caps_make_writable (caps);
|
||||
caps = gst_caps_copy (GST_PAD_CAPS (mux->srcpad));
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
|
||||
g_value_init (&array, GST_TYPE_ARRAY);
|
||||
|
@ -987,6 +987,7 @@ mpegtsdemux_prepare_srcpad (MpegTsMux * mux)
|
|||
|
||||
/* Set caps on src pad from our template and push new segment */
|
||||
gst_pad_set_caps (mux->srcpad, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
if (!gst_pad_push_event (mux->srcpad, new_seg)) {
|
||||
GST_WARNING_OBJECT (mux, "New segment event was not handled downstream");
|
||||
|
|
Loading…
Reference in a new issue