s = gst_caps_get_structure (caps, i);
s1 = gst_structure_copy (s);
- s2 = gst_structure_copy (s);
- s3 = NULL;
if (videorate->updating_caps) {
GST_INFO_OBJECT (trans,
ret = gst_caps_merge_structure (ret, s1);
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 max_num = G_MAXINT, max_denom = 1;
GstStructure *st;
gint fps_d, fps_n;
GstCaps *srcpadcaps, *tmpcaps;
-
GstPad *pad = NULL;
srcpadcaps =
gst_video_guess_framerate (GST_BUFFER_PTS (buffer) -
GST_BUFFER_PTS (videorate->prevbuf), &fps_n, &fps_d);
+
tmpcaps = gst_caps_copy (srcpadcaps);
st = gst_caps_get_structure (tmpcaps, 0);
gst_structure_set (st, "framerate", GST_TYPE_FRACTION, fps_n, fps_d, NULL);
gst_base_transform_update_src_caps (GST_BASE_TRANSFORM (videorate), tmpcaps);
done:
+ gst_caps_unref (tmpcaps);
if (pad)
gst_object_unref (pad);
}
GST_START_TEST (test_fixed_framerate)
{
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
* it on downstream (if possible; otherwise fixate_to_nearest)