From 3f7138a6e497e1d5635f7af798c3d2fc1d04d32b Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 2 Oct 2015 15:05:26 +1000 Subject: [PATCH] videotestsrc: Don't fixate framerate if downstream didn't provide one intersection with a downstream that accepts any video/x-raw caps with no further detail won't create a framerate field. If it's not in the caps, don't fixate it, just set it to 30/1 --- gst/videotestsrc/gstvideotestsrc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index f646b4c2c1..2918264de3 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -321,7 +321,11 @@ gst_video_test_src_src_fixate (GstBaseSrc * bsrc, GstCaps * caps) gst_structure_fixate_field_nearest_int (structure, "width", 320); gst_structure_fixate_field_nearest_int (structure, "height", 240); - gst_structure_fixate_field_nearest_fraction (structure, "framerate", 30, 1); + + if (gst_structure_has_field (structure, "framerate")) + gst_structure_fixate_field_nearest_fraction (structure, "framerate", 30, 1); + else + gst_structure_set (structure, "framerate", GST_TYPE_FRACTION, 30, 1, NULL); if (gst_structure_has_field (structure, "pixel-aspect-ratio")) gst_structure_fixate_field_nearest_fraction (structure,