mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
video-track: don't leak restriction caps in _sync_capsfilter_with_track()
https://bugzilla.gnome.org/show_bug.cgi?id=766450
This commit is contained in:
parent
90b5735f7a
commit
7529e25b49
1 changed files with 11 additions and 7 deletions
|
@ -42,14 +42,15 @@ _sync_capsfilter_with_track (GESTrack * track, GstElement * capsfilter)
|
|||
GstStructure *structure;
|
||||
|
||||
g_object_get (track, "restriction-caps", &restriction, NULL);
|
||||
if (restriction && gst_caps_get_size (restriction) > 0) {
|
||||
|
||||
structure = gst_caps_get_structure (restriction, 0);
|
||||
if (!gst_structure_get_fraction (structure, "framerate", &fps_n, &fps_d))
|
||||
return;
|
||||
} else {
|
||||
if (restriction == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
if (gst_caps_get_size (restriction) == 0)
|
||||
goto done;
|
||||
|
||||
structure = gst_caps_get_structure (restriction, 0);
|
||||
if (!gst_structure_get_fraction (structure, "framerate", &fps_n, &fps_d))
|
||||
goto done;
|
||||
|
||||
caps =
|
||||
gst_caps_new_simple ("video/x-raw", "framerate", GST_TYPE_FRACTION, fps_n,
|
||||
|
@ -57,6 +58,9 @@ _sync_capsfilter_with_track (GESTrack * track, GstElement * capsfilter)
|
|||
|
||||
g_object_set (capsfilter, "caps", caps, NULL);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
done:
|
||||
gst_caps_unref (restriction);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue