diff --git a/gst/rtsp-server/rtsp-media.c b/gst/rtsp-server/rtsp-media.c index 18f2e8554f..2bd81ebf41 100644 --- a/gst/rtsp-server/rtsp-media.c +++ b/gst/rtsp-server/rtsp-media.c @@ -361,7 +361,7 @@ collect_media_stats (GstRTSPMedia * media) * gst_rtsp_media_new: * * Create a new #GstRTSPMedia instance. The #GstRTSPMedia object contains the - * element to produde RTP data for one or more related (audio/video/..) + * element to produce RTP data for one or more related (audio/video/..) * streams. * * Returns: a new #GstRTSPMedia object. @@ -1078,7 +1078,8 @@ find_transport (GstRTSPMediaStream * stream, const gchar * rtcp_from) port = atoi (tmp + 1); dest = g_strndup (rtcp_from, tmp - rtcp_from); - GST_INFO ("finding %s:%d", dest, port); + GST_INFO ("finding %s:%d in %d transports", dest, port, + g_list_length (stream->transports)); for (walk = stream->transports; walk; walk = g_list_next (walk)) { GstRTSPMediaTrans *trans = walk->data; @@ -1098,14 +1099,12 @@ find_transport (GstRTSPMediaStream * stream, const gchar * rtcp_from) return result; } -static void -on_new_ssrc (GObject * session, GObject * source, GstRTSPMediaStream * stream) +static GstRTSPMediaTrans * +check_transport (GObject * source, GstRTSPMediaStream * stream) { GstStructure *stats; GstRTSPMediaTrans *trans; - GST_INFO ("%p: new source %p", stream, source); - /* see if we have a stream to match with the origin of the RTCP packet */ trans = g_object_get_qdata (source, ssrc_stream_map_key); if (trans == NULL) { @@ -1127,9 +1126,22 @@ on_new_ssrc (GObject * session, GObject * source, GstRTSPMediaStream * stream) } gst_structure_free (stats); } - } else { - GST_INFO ("%p: source %p for transport %p", stream, source, trans); } + + return trans; +} + +static void +on_new_ssrc (GObject * session, GObject * source, GstRTSPMediaStream * stream) +{ + GstRTSPMediaTrans *trans; + + GST_INFO ("%p: new source %p", stream, source); + + trans = check_transport (source, stream); + + if (trans) + GST_INFO ("%p: source %p for transport %p", stream, source, trans); } static void @@ -1144,9 +1156,10 @@ on_ssrc_active (GObject * session, GObject * source, { GstRTSPMediaTrans *trans; - trans = g_object_get_qdata (source, ssrc_stream_map_key); + trans = check_transport (source, stream); - GST_INFO ("%p: source %p in transport %p is active", stream, source, trans); + if (trans) + GST_INFO ("%p: source %p in transport %p is active", stream, source, trans); if (trans && trans->keep_alive) trans->keep_alive (trans->ka_user_data);