diff --git a/gst/rtpmux/gstrtpmux.c b/gst/rtpmux/gstrtpmux.c
index ba7243e..65fb5cc 100644
--- a/gst/rtpmux/gstrtpmux.c
+++ b/gst/rtpmux/gstrtpmux.c
@@ -409,6 +409,7 @@ gst_rtp_mux_setcaps (GstPad *pad, GstCaps *caps)
   gboolean ret = TRUE;
   gint clock_rate;
   GstRTPMuxPadPrivate *padpriv = gst_pad_get_element_private (pad);
+  GstCaps *peercaps ;
 
   rtp_mux = GST_RTP_MUX (gst_pad_get_parent (pad));
 
@@ -431,6 +432,26 @@ gst_rtp_mux_setcaps (GstPad *pad, GstCaps *caps)
       "seqnum-base", G_TYPE_UINT, rtp_mux->seqnum_base,
       NULL);
 
+
+  /* the peer caps can override some of the defaults */
+  peercaps = gst_pad_peer_get_caps (rtp_mux->srcpad);
+  if ( peercaps ) {
+    const GValue *value;
+    GstStructure *s ;
+    s = gst_caps_get_structure(peercaps, 0); 
+    if (gst_structure_has_field_typed (s, "ssrc", G_TYPE_UINT)) {
+      value = gst_structure_get_value (s, "ssrc");
+      rtp_mux->current_ssrc = g_value_get_uint (value);
+      GST_LOG_OBJECT (rtp_mux, "using peer ssrc %08x", rtp_mux->current_ssrc);
+    } else {
+      GST_LOG_OBJECT (rtp_mux, "using internal ssrc %08x",
+		      rtp_mux->current_ssrc);
+    }
+    gst_caps_unref (peercaps);
+  }
+
+  gst_caps_set_simple(caps, "ssrc", G_TYPE_UINT, rtp_mux->current_ssrc, NULL);
+
   GST_DEBUG_OBJECT (rtp_mux,
       "setting caps %" GST_PTR_FORMAT " on src pad..", caps);
   ret = gst_pad_set_caps (rtp_mux->srcpad, caps);
