gst/rtpmanager/gstrtpbin.c: Reset the sync parameters when clearing the payload type...
authorWim Taymans <wim.taymans@gmail.com>
Wed, 26 Nov 2008 12:02:21 +0000 (12:02 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Wed, 26 Nov 2008 12:02:21 +0000 (12:02 +0000)
Original commit message from CVS:
* gst/rtpmanager/gstrtpbin.c: (gst_rtp_bin_reset_sync),
(gst_rtp_bin_clear_pt_map):
Reset the sync parameters when clearing the payload type map too.
Fixes #562312.

ChangeLog
gst/rtpmanager/gstrtpbin.c

index 25abffa..e2b6fb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-11-26  Wim Taymans  <wim.taymans@collabora.co.uk>
 
+       * gst/rtpmanager/gstrtpbin.c: (gst_rtp_bin_reset_sync),
+       (gst_rtp_bin_clear_pt_map):
+       Reset the sync parameters when clearing the payload type map too.
+       Fixes #562312.
+
+2008-11-26  Wim Taymans  <wim.taymans@collabora.co.uk>
+
        * gst/rtpmanager/gstrtpbin.c: (get_client),
        (gst_rtp_bin_reset_sync), (gst_rtp_bin_associate),
        (gst_rtp_bin_handle_sync), (create_stream),
index 801a4b2..a845bbb 100644 (file)
@@ -686,6 +686,30 @@ return_true (gpointer key, gpointer value, gpointer user_data)
 }
 
 static void
+gst_rtp_bin_reset_sync (GstRtpBin * rtpbin)
+{
+  GSList *clients, *streams;
+
+  GST_DEBUG_OBJECT (rtpbin, "Reset sync on all clients");
+
+  GST_RTP_BIN_LOCK (rtpbin);
+  for (clients = rtpbin->clients; clients; clients = g_slist_next (clients)) {
+    GstRtpBinClient *client = (GstRtpBinClient *) clients->data;
+
+    /* reset sync on all streams for this client */
+    for (streams = client->streams; streams; streams = g_slist_next (streams)) {
+      GstRtpBinStream *stream = (GstRtpBinStream *) streams->data;
+
+      /* make use require a new SR packet for this stream before we attempt new
+       * lip-sync */
+      stream->have_sync = FALSE;
+      stream->unix_delta = 0;
+    }
+  }
+  GST_RTP_BIN_UNLOCK (rtpbin);
+}
+
+static void
 gst_rtp_bin_clear_pt_map (GstRtpBin * bin)
 {
   GSList *sessions, *streams;
@@ -711,6 +735,9 @@ gst_rtp_bin_clear_pt_map (GstRtpBin * bin)
     GST_RTP_SESSION_UNLOCK (session);
   }
   GST_RTP_BIN_UNLOCK (bin);
+
+  /* reset sync too */
+  gst_rtp_bin_reset_sync (bin);
 }
 
 static RTPSession *
@@ -794,30 +821,6 @@ free_client (GstRtpBinClient * client)
   g_free (client);
 }
 
-static void
-gst_rtp_bin_reset_sync (GstRtpBin * rtpbin)
-{
-  GSList *clients, *streams;
-
-  GST_DEBUG_OBJECT (rtpbin, "Reset sync on all clients");
-
-  GST_RTP_BIN_LOCK (rtpbin);
-  for (clients = rtpbin->clients; clients; clients = g_slist_next (clients)) {
-    GstRtpBinClient *client = (GstRtpBinClient *) clients->data;
-
-    /* reset sync on all streams for this client */
-    for (streams = client->streams; streams; streams = g_slist_next (streams)) {
-      GstRtpBinStream *stream = (GstRtpBinStream *) streams->data;
-
-      /* make use require a new SR packet for this stream before we attempt new
-       * lip-sync */
-      stream->have_sync = FALSE;
-      stream->unix_delta = 0;
-    }
-  }
-  GST_RTP_BIN_UNLOCK (rtpbin);
-}
-
 /* associate a stream to the given CNAME. This will make sure all streams for
  * that CNAME are synchronized together.
  * Must be called with GST_RTP_BIN_LOCK */