From 290cafefebb26e301e50097c6351c72754f45e21 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 23 Jun 2005 16:23:12 +0000 Subject: [PATCH] gst/videorate/gstvideorate.c: Fixed videorate, fixating an already fixated caps is not an error. Original commit message from CVS: * gst/videorate/gstvideorate.c: (gst_videorate_transformcaps), (gst_videorate_getcaps), (gst_videorate_setcaps), (gst_videorate_event), (gst_videorate_chain): Fixed videorate, fixating an already fixated caps is not an error. --- ChangeLog | 8 ++++++++ gst/videorate/gstvideorate.c | 25 +++++++++++++++---------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4058720f9d..c970189386 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-06-23 Wim Taymans + + * gst/videorate/gstvideorate.c: (gst_videorate_transformcaps), + (gst_videorate_getcaps), (gst_videorate_setcaps), + (gst_videorate_event), (gst_videorate_chain): + Fixed videorate, fixating an already fixated caps is not + an error. + 2005-06-23 Wim Taymans * ext/ogg/README: diff --git a/gst/videorate/gstvideorate.c b/gst/videorate/gstvideorate.c index 7ade9fa277..4ac31face3 100644 --- a/gst/videorate/gstvideorate.c +++ b/gst/videorate/gstvideorate.c @@ -294,28 +294,33 @@ gst_videorate_setcaps (GstPad * pad, GstCaps * caps) /* see what the peer can do */ peercaps = gst_pad_get_caps (opeer); + GST_DEBUG ("icaps %" GST_PTR_FORMAT, peercaps); + GST_DEBUG ("transform %" GST_PTR_FORMAT, transform); + /* filter against our possibilities */ intersect = gst_caps_intersect (peercaps, transform); gst_caps_unref (peercaps); gst_caps_unref (transform); + GST_DEBUG ("intersect %" GST_PTR_FORMAT, intersect); + /* take first possibility */ caps = gst_caps_copy_nth (intersect, 0); gst_caps_unref (intersect); structure = gst_caps_get_structure (caps, 0); /* and fixate */ - if (gst_caps_structure_fixate_field_nearest_int (structure, "framerate", - fps)) { - gst_structure_get_double (structure, "framerate", &fps); - if (otherpad == videorate->srcpad) { - videorate->to_fps = fps; - } else { - videorate->from_fps = fps; - } - gst_pad_set_caps (otherpad, caps); - ret = TRUE; + gst_caps_structure_fixate_field_nearest_int (structure, "framerate", fps); + + gst_structure_get_double (structure, "framerate", &fps); + + if (otherpad == videorate->srcpad) { + videorate->to_fps = fps; + } else { + videorate->from_fps = fps; } + gst_pad_set_caps (otherpad, caps); + ret = TRUE; } gst_object_unref (GST_OBJECT (opeer)); }