[farsight2/master] Drop buffers that don't match with our caps, don't leak intersected caps

Olivier Crête olivier.crete at collabora.co.uk
Mon Mar 16 09:21:48 PDT 2009


---
 gst/fsrtpconference/fs-rtp-substream.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-substream.c b/gst/fsrtpconference/fs-rtp-substream.c
index 3e6f41b..b591b93 100644
--- a/gst/fsrtpconference/fs-rtp-substream.c
+++ b/gst/fsrtpconference/fs-rtp-substream.c
@@ -1179,14 +1179,11 @@ _rtpbin_pad_have_data_callback (GstPad *pad, GstMiniObject *miniobj,
       GstCaps *intersect = gst_caps_intersect (GST_BUFFER_CAPS (miniobj),
           self->priv->caps);
 
-      if (intersect)
-      {
-        gst_buffer_set_caps (GST_BUFFER (miniobj), self->priv->caps);
-
-        gst_caps_unref (intersect);
-      }
-      else
+      if (gst_caps_is_empty (intersect))
         ret = FALSE;
+      else
+        gst_buffer_set_caps (GST_BUFFER (miniobj), self->priv->caps);
+      gst_caps_unref (intersect);
     }
     else
     {
-- 
1.5.6.5




More information about the farsight-commits mailing list