client: dump rtsp message only if debug threshold is higher than GST_LEVEL_LOG
authorSebastian Pölsterl <sebp@k-d-w.org>
Sat, 21 Nov 2009 00:17:25 +0000 (01:17 +0100)
committerSebastian Pölsterl <sebp@k-d-w.org>
Sat, 21 Nov 2009 18:20:39 +0000 (19:20 +0100)
gst/rtsp-server/rtsp-client.c

index 22477b2..c8f75dc 100644 (file)
@@ -23,8 +23,6 @@
 #include "rtsp-sdp.h"
 #include "rtsp-params.h"
 
-#define DEBUG
-
 static GMutex *tunnels_lock;
 static GHashTable *tunnels;
 
@@ -191,9 +189,10 @@ send_response (GstRTSPClient * client, GstRTSPSession * session,
 
     gst_rtsp_message_take_header (response, GST_RTSP_HDR_SESSION, str);
   }
-#ifdef DEBUG
-  gst_rtsp_message_dump (response);
-#endif
+
+  if (gst_debug_category_get_threshold (rtsp_client_debug) >= GST_LEVEL_LOG) {
+    gst_rtsp_message_dump (response);
+  }
 
   gst_rtsp_watch_send_message (client->watch, response, NULL);
   gst_rtsp_message_unset (response);
@@ -1064,9 +1063,9 @@ handle_request (GstRTSPClient * client, GstRTSPMessage * request)
   GstRTSPSession *session;
   gchar *sessid;
 
-#ifdef DEBUG
-  gst_rtsp_message_dump (request);
-#endif
+  if (gst_debug_category_get_threshold (rtsp_client_debug) >= GST_LEVEL_LOG) {
+    gst_rtsp_message_dump (request);
+  }
 
   GST_INFO ("client %p: received a request", client);