- /* Should always be called with simple caps */
- g_return_val_if_fail (GST_CAPS_IS_SIMPLE (caps), NULL);
-
- ret = gst_caps_copy (caps);
-
- s = gst_caps_get_structure (ret, 0);
- s2 = gst_structure_copy (s);
-
- if (videorate->drop_only) {
- gint min_num = 0, min_denom = 1;
- gint max_num = G_MAXINT, max_denom = 1;
-
- /* Clamp the caps to our maximum rate as the first caps if possible */
- if (!gst_video_max_rate_clamp_structure (s, maxrate,
- &min_num, &min_denom, &max_num, &max_denom)) {
- min_num = 0;
- min_denom = 1;
- max_num = maxrate;
- max_denom = 1;
-
- /* clamp wouldn't be a real subset of 1..maxrate, in this case the sink
- * caps should become [1..maxrate], [1..maxint] and the src caps just
- * [1..maxrate]. In case there was a caps incompatibility things will
- * explode later as appropriate :)
- *
- * In case [X..maxrate] == [X..maxint], skip as we'll set it later
- */
- if (direction == GST_PAD_SRC && maxrate != G_MAXINT)
- gst_structure_set (s, "framerate", GST_TYPE_FRACTION_RANGE,
- min_num, min_denom, maxrate, 1, NULL);
- else
- gst_caps_remove_structure (ret, 0);
- }
-
- if (direction == GST_PAD_SRC) {
- /* We can accept anything as long as it's at least the minimal framerate
- * the the sink needs */
- gst_structure_set (s2, "framerate", GST_TYPE_FRACTION_RANGE,
- min_num, min_denom, G_MAXINT, 1, NULL);
+ if (direction == GST_PAD_SRC) {
+ /* We can accept anything as long as it's at least the minimal framerate
+ * the the sink needs */
+ gst_structure_set (s2, "framerate", GST_TYPE_FRACTION_RANGE,
+ min_num, min_denom, G_MAXINT, 1, NULL);