mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
videorate: fix a couple of memory leaks
tests: videorate: fix leak in unit test
This commit is contained in:
parent
c888e9f984
commit
413fc30235
2 changed files with 9 additions and 5 deletions
|
@ -371,8 +371,6 @@ gst_video_rate_transform_caps (GstBaseTransform * trans,
|
||||||
s = gst_caps_get_structure (caps, i);
|
s = gst_caps_get_structure (caps, i);
|
||||||
|
|
||||||
s1 = gst_structure_copy (s);
|
s1 = gst_structure_copy (s);
|
||||||
s2 = gst_structure_copy (s);
|
|
||||||
s3 = NULL;
|
|
||||||
|
|
||||||
if (videorate->updating_caps) {
|
if (videorate->updating_caps) {
|
||||||
GST_INFO_OBJECT (trans,
|
GST_INFO_OBJECT (trans,
|
||||||
|
@ -384,7 +382,12 @@ gst_video_rate_transform_caps (GstBaseTransform * trans,
|
||||||
ret = gst_caps_merge_structure (ret, s1);
|
ret = gst_caps_merge_structure (ret, s1);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
} else if (videorate->drop_only) {
|
}
|
||||||
|
|
||||||
|
s2 = gst_structure_copy (s);
|
||||||
|
s3 = NULL;
|
||||||
|
|
||||||
|
if (videorate->drop_only) {
|
||||||
gint min_num = 0, min_denom = 1;
|
gint min_num = 0, min_denom = 1;
|
||||||
gint max_num = G_MAXINT, max_denom = 1;
|
gint max_num = G_MAXINT, max_denom = 1;
|
||||||
|
|
||||||
|
@ -1004,7 +1007,6 @@ gst_video_rate_check_variable_rate (GstVideoRate * videorate,
|
||||||
GstStructure *st;
|
GstStructure *st;
|
||||||
gint fps_d, fps_n;
|
gint fps_d, fps_n;
|
||||||
GstCaps *srcpadcaps, *tmpcaps;
|
GstCaps *srcpadcaps, *tmpcaps;
|
||||||
|
|
||||||
GstPad *pad = NULL;
|
GstPad *pad = NULL;
|
||||||
|
|
||||||
srcpadcaps =
|
srcpadcaps =
|
||||||
|
@ -1012,6 +1014,7 @@ gst_video_rate_check_variable_rate (GstVideoRate * videorate,
|
||||||
|
|
||||||
gst_video_guess_framerate (GST_BUFFER_PTS (buffer) -
|
gst_video_guess_framerate (GST_BUFFER_PTS (buffer) -
|
||||||
GST_BUFFER_PTS (videorate->prevbuf), &fps_n, &fps_d);
|
GST_BUFFER_PTS (videorate->prevbuf), &fps_n, &fps_d);
|
||||||
|
|
||||||
tmpcaps = gst_caps_copy (srcpadcaps);
|
tmpcaps = gst_caps_copy (srcpadcaps);
|
||||||
st = gst_caps_get_structure (tmpcaps, 0);
|
st = gst_caps_get_structure (tmpcaps, 0);
|
||||||
gst_structure_set (st, "framerate", GST_TYPE_FRACTION, fps_n, fps_d, NULL);
|
gst_structure_set (st, "framerate", GST_TYPE_FRACTION, fps_n, fps_d, NULL);
|
||||||
|
@ -1036,6 +1039,7 @@ gst_video_rate_check_variable_rate (GstVideoRate * videorate,
|
||||||
gst_base_transform_update_src_caps (GST_BASE_TRANSFORM (videorate), tmpcaps);
|
gst_base_transform_update_src_caps (GST_BASE_TRANSFORM (videorate), tmpcaps);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
gst_caps_unref (tmpcaps);
|
||||||
if (pad)
|
if (pad)
|
||||||
gst_object_unref (pad);
|
gst_object_unref (pad);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1095,7 +1095,7 @@ videorate_send_buffers (GstElement * videorate,
|
||||||
GST_START_TEST (test_fixed_framerate)
|
GST_START_TEST (test_fixed_framerate)
|
||||||
{
|
{
|
||||||
GstElement *videorate;
|
GstElement *videorate;
|
||||||
GstCaps *caps = gst_caps_from_string ("video/x-raw,framerate=0/1");
|
GstCaps *caps;
|
||||||
|
|
||||||
/* 1) if upstream caps contain a non-0/1 framerate, we should use that and pass
|
/* 1) if upstream caps contain a non-0/1 framerate, we should use that and pass
|
||||||
* it on downstream (if possible; otherwise fixate_to_nearest)
|
* it on downstream (if possible; otherwise fixate_to_nearest)
|
||||||
|
|
Loading…
Reference in a new issue