commit 870dbfda110f495ac0516a109ccec07e9a3f1ddf
Author: Wim Taymans <wim.taymans@collabora.co.uk>
Date:   Tue Jun 29 10:46:41 2010 +0200

    rtspsrc: improve error and warning message
    
    Improve error and warning message.
    
    Fixes #622577

diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index 4dae552..9b33bf5 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -3645,12 +3645,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;
 
@@ -3672,6 +3666,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;
@@ -3723,8 +3724,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:
