multifilesrc: fix caps leak

since `gst_caps_replace()` and `gst_pad_set_caps()` both ref the caps and neither of them takes the ownership of the caps -> it must be unreffed in `gst_multi_file_src_set_property()`

to test the leak (on Unix): `echo coucou > /tmp/file.txt && GST_TRACERS=leaks GST_DEBUG="GST_TRACER:7" gst-launch-1.0 multifilesrc location=/tmp/file.txt caps='txt' ! fakesink`

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1436>
This commit is contained in:
Célestin Marot 2021-12-10 17:36:30 +01:00
parent e8c923ebde
commit f509578de5

View file

@ -343,6 +343,7 @@ gst_multi_file_src_set_property (GObject * object, guint prop_id,
src->fps_n = -1; src->fps_n = -1;
src->fps_d = -1; src->fps_d = -1;
} }
gst_caps_unref (new_caps);
} }
break; break;
case PROP_LOOP: case PROP_LOOP: