From e39d7f7359fe9d292738ff5e3086ad78d02a93ea Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 29 Jun 2010 10:46:41 +0200 Subject: [PATCH] rtspsrc: improve error and warning message Improve error and warning message. Fixes #622577 --- gst/rtsp/gstrtspsrc.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index ac5b12912d..855cf8652b 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -3703,12 +3703,6 @@ gst_rtspsrc_loop_udp (GstRTSPSrc * src) if (!restart) goto done; - /* We post a warning message now to inform the user - * that nothing happened. It's most likely a firewall thing. */ - GST_ELEMENT_WARNING (src, RESOURCE, READ, (NULL), - ("Could not receive any UDP packets for %.4f seconds, maybe your " - "firewall is blocking it. Retrying using a TCP connection.", - gst_guint64_to_gdouble (src->udp_timeout / 1000000.0))); /* we can try only TCP now */ src->cur_protocols = GST_RTSP_LOWER_TRANS_TCP; @@ -3730,6 +3724,13 @@ gst_rtspsrc_loop_udp (GstRTSPSrc * src) if (!(src->protocols & GST_RTSP_LOWER_TRANS_TCP)) goto no_protocols; + /* We post a warning message now to inform the user + * that nothing happened. It's most likely a firewall thing. */ + GST_ELEMENT_WARNING (src, RESOURCE, READ, (NULL), + ("Could not receive any UDP packets for %.4f seconds, maybe your " + "firewall is blocking it. Retrying using a TCP connection.", + gst_guint64_to_gdouble (src->udp_timeout / 1000000.0))); + /* open new connection using tcp */ if (!gst_rtspsrc_open (src)) goto open_failed; @@ -3781,8 +3782,10 @@ no_protocols: { src->cur_protocols = 0; /* no transport possible, post an error and stop */ - GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ_WRITE, (NULL), - ("Could not connect to server, no protocols left")); + GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), + ("Could not receive any UDP packets for %.4f seconds, maybe your " + "firewall is blocking it. No other protocols to try.", + gst_guint64_to_gdouble (src->udp_timeout / 1000000.0))); return GST_FLOW_ERROR; } open_failed: