From f25e221766270e0eb65ebbcdba7cdd7e45c0def1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Fri, 2 Nov 2007 22:30:10 +0000 Subject: [PATCH] dont use ffmpeg RTSP status codes --- rtsp.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/rtsp.c b/rtsp.c index 90b91577..33aa0ae9 100644 --- a/rtsp.c +++ b/rtsp.c @@ -42,10 +42,18 @@ #include "tcp.h" #include "http.h" -#include -#include #include +#define RTSP_STATUS_OK 200 +#define RTSP_STATUS_UNAUTHORIZED 401 +#define RTSP_STATUS_METHOD 405 +#define RTSP_STATUS_SESSION 454 +#define RTSP_STATUS_TRANSPORT 461 +#define RTSP_STATUS_INTERNAL 500 +#define RTSP_STATUS_SERVICE 503 + + + #define rcprintf(c, fmt...) tcp_printf(&(rc)->rc_tcp_session, fmt) static AVRandomState rtsp_rnd; @@ -218,16 +226,12 @@ rtsp_err2str(int err) { switch(err) { case RTSP_STATUS_OK: return "OK"; + case RTSP_STATUS_UNAUTHORIZED: return "Unauthorized"; case RTSP_STATUS_METHOD: return "Method Not Allowed"; - case RTSP_STATUS_BANDWIDTH: return "Not Enough Bandwidth"; case RTSP_STATUS_SESSION: return "Session Not Found"; - case RTSP_STATUS_STATE: return "Method Not Valid in This State"; - case RTSP_STATUS_AGGREGATE: return "Aggregate operation not allowed"; - case RTSP_STATUS_ONLY_AGGREGATE: return "Only aggregate operation allowed"; case RTSP_STATUS_TRANSPORT: return "Unsupported transport"; case RTSP_STATUS_INTERNAL: return "Internal Server Error"; case RTSP_STATUS_SERVICE: return "Service Unavailable"; - case RTSP_STATUS_VERSION: return "RTSP Version not supported"; default: return "Unknown Error"; break; @@ -253,6 +257,7 @@ rtsp_reply_error(http_connection_t *hc, int error, const char *errstr) http_printf(hc, "\r\n"); } + /* * Find a session pointed do by the current connection */ @@ -383,7 +388,7 @@ rtsp_cmd_setup(http_connection_t *hc) rtsp_session_t *rs; th_channel_t *ch; struct sockaddr_in dst; - + if((ch = rtsp_channel_by_url(hc->hc_url)) == NULL) { rtsp_reply_error(hc, RTSP_STATUS_SERVICE, "URL does not resolve"); return;