diff --git a/subprojects/gst-plugins-base/gst/videorate/gstvideorate.c b/subprojects/gst-plugins-base/gst/videorate/gstvideorate.c index 2a9f2c056a..f16b475383 100644 --- a/subprojects/gst-plugins-base/gst/videorate/gstvideorate.c +++ b/subprojects/gst-plugins-base/gst/videorate/gstvideorate.c @@ -503,6 +503,11 @@ gst_video_rate_transform_caps (GstBaseTransform * trans, /* We can provide everything up to the maximum framerate at the src */ gst_structure_set (s2, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, max_num, max_denom, NULL); + } else if (min_num == 0) { + /* if provided with variable framerate input, then we don't have a + * restriction on the output framerate currently */ + gst_structure_set (s2, "framerate", GST_TYPE_FRACTION_RANGE, + min_num, 1, maxrate, 1, NULL); } } else if (direction == GST_PAD_SINK) { gint min_num = 0, min_denom = 1; diff --git a/subprojects/gst-plugins-base/tests/check/elements/videorate.c b/subprojects/gst-plugins-base/tests/check/elements/videorate.c index 19c15f9603..51a2bbd508 100644 --- a/subprojects/gst-plugins-base/tests/check/elements/videorate.c +++ b/subprojects/gst-plugins-base/tests/check/elements/videorate.c @@ -1090,6 +1090,25 @@ static TestInfo caps_negotiation_tests[] = { .expected_src_caps = "video/x-raw, framerate=(fraction)15/1;" "video/x-raw, framerate=(fraction)[0/1, 20/1]"}, + { + .caps = "video/x-raw, framerate=0/1", + .drop_only = TRUE, + .expected_sink_caps = + "video/x-raw, framerate=(fraction)0/1;" + "video/x-raw, framerate=(fraction)[0/1, MAX];", + .expected_src_caps = + "video/x-raw, framerate=(fraction)0/1;" + "video/x-raw, framerate=(fraction)[0/1, MAX]"}, + { + .caps = "video/x-raw, framerate=0/1", + .drop_only = TRUE, + .max_rate = 15, + .expected_sink_caps = + "video/x-raw, framerate=(fraction)0/1;" + "video/x-raw, framerate=(fraction)[0/1, MAX];", + .expected_src_caps = + "video/x-raw, framerate=(fraction)0/1;" + "video/x-raw, framerate=(fraction)[0/1, 15/1]"}, }; static gboolean