[farsight2/master] rtcpfilter: Verify if there is at least one packet

Olivier Crête olivier.crete at collabora.co.uk
Tue May 12 09:03:38 PDT 2009


---
 gst/rtcpfilter/fs-rtcp-filter.c |   25 +++++++++++++------------
 1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/gst/rtcpfilter/fs-rtcp-filter.c b/gst/rtcpfilter/fs-rtcp-filter.c
index b279c7a..e6abe54 100644
--- a/gst/rtcpfilter/fs-rtcp-filter.c
+++ b/gst/rtcpfilter/fs-rtcp-filter.c
@@ -197,20 +197,21 @@ fs_rtcp_filter_transform_ip (GstBaseTransform *transform, GstBuffer *buf)
     GstRTCPPacket packet;
     gboolean modified = FALSE;
 
-    gst_rtcp_buffer_get_first_packet (buf, &packet);
-
-    for (;;)
+    if (gst_rtcp_buffer_get_first_packet (buf, &packet))
     {
-      if (gst_rtcp_packet_get_type (&packet) == GST_RTCP_TYPE_SR)
-      {
-        if (!gst_rtcp_packet_remove (&packet))
-          break;
-        modified = TRUE;
-      }
-      else
+      for (;;)
       {
-        if (!gst_rtcp_packet_move_to_next (&packet))
-          break;
+        if (gst_rtcp_packet_get_type (&packet) == GST_RTCP_TYPE_SR)
+        {
+          if (!gst_rtcp_packet_remove (&packet))
+            break;
+          modified = TRUE;
+        }
+        else
+        {
+          if (!gst_rtcp_packet_move_to_next (&packet))
+            break;
+        }
       }
     }
 
-- 
1.5.6.5




More information about the farsight-commits mailing list