[farsight2/master] Give preference to the original rate, but allow any rate

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:24:06 PST 2008


---
 gst/videoanyrate/videoanyrate.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gst/videoanyrate/videoanyrate.c b/gst/videoanyrate/videoanyrate.c
index 542a60e..746b1ad 100644
--- a/gst/videoanyrate/videoanyrate.c
+++ b/gst/videoanyrate/videoanyrate.c
@@ -118,7 +118,7 @@ gst_videoanyrate_transform_caps (GstBaseTransform *trans,
     GstPadDirection direction,
     GstCaps *caps)
 {
-  GstStructure *s;
+  GstStructure *s, *s2;
   GstCaps *mycaps = gst_caps_make_writable (caps);
 
   if (gst_caps_get_size (mycaps) == 0)
@@ -126,7 +126,12 @@ gst_videoanyrate_transform_caps (GstBaseTransform *trans,
 
   s = gst_caps_get_structure (mycaps, 0);
 
-  gst_structure_remove_field (s, "framerate");
+  if (gst_structure_has_field (s, "framerate"))
+  {
+    s2 = gst_structure_copy (s);
+    gst_structure_remove_field (s2, "framerate");
+    gst_caps_append_structure (mycaps, s2);
+  }
 
   return gst_caps_ref (mycaps);
 }
-- 
1.5.6.5




More information about the farsight-commits mailing list