1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-11 17:37:23 +00:00

cosmetic changes to avoid constants redefinition

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18826 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
ben 2006-06-26 17:27:38 +00:00
parent 1f3936ab24
commit b31df04b82

View File

@ -53,6 +53,13 @@
#define LOG #define LOG
*/ */
#define RTSP_OPTIONS_SERVER "Server"
#define RTSP_OPTIONS_LOCATION "Location"
#define RTSP_OPTIONS_REAL "RealChallenge1"
#define RTSP_SERVER_TYPE_REAL "Real"
#define RTSP_SERVER_TYPE_HELIX "Helix"
#define RTSP_SERVER_TYPE_UNKNOWN "unknown"
struct rtsp_session_s { struct rtsp_session_s {
rtsp_t *s; rtsp_t *s;
struct real_rtsp_session_t* real_session; struct real_rtsp_session_t* real_session;
@ -83,25 +90,25 @@ rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host, i
} }
/* looking for server type */ /* looking for server type */
if (rtsp_search_answers(rtsp_session->s,"Server")) if (rtsp_search_answers(rtsp_session->s,RTSP_OPTIONS_SERVER))
server=strdup(rtsp_search_answers(rtsp_session->s,"Server")); server=strdup(rtsp_search_answers(rtsp_session->s,RTSP_OPTIONS_SERVER));
else { else {
if (rtsp_search_answers(rtsp_session->s,"RealChallenge1")) if (rtsp_search_answers(rtsp_session->s,RTSP_OPTIONS_REAL))
server=strdup("Real"); server=strdup(RTSP_SERVER_TYPE_REAL);
else else
server=strdup("unknown"); server=strdup(RTSP_SERVER_TYPE_UNKNOWN);
} }
if (strstr(server,"Real") || strstr(server,"Helix")) if (strstr(server,RTSP_SERVER_TYPE_REAL) || strstr(server,RTSP_SERVER_TYPE_HELIX))
{ {
/* we are talking to a real server ... */ /* we are talking to a real server ... */
h=real_setup_and_get_header(rtsp_session->s, bandwidth); h=real_setup_and_get_header(rtsp_session->s, bandwidth);
if (!h) { if (!h) {
/* got an redirect? */ /* got an redirect? */
if (rtsp_search_answers(rtsp_session->s, "Location")) if (rtsp_search_answers(rtsp_session->s, RTSP_OPTIONS_LOCATION))
{ {
free(mrl_line); free(mrl_line);
mrl_line=strdup(rtsp_search_answers(rtsp_session->s, "Location")); mrl_line=strdup(rtsp_search_answers(rtsp_session->s, RTSP_OPTIONS_LOCATION));
mp_msg (MSGT_OPEN, MSGL_INFO,"rtsp_session: redirected to %s\n", mrl_line); mp_msg (MSGT_OPEN, MSGL_INFO,"rtsp_session: redirected to %s\n", mrl_line);
rtsp_close(rtsp_session->s); rtsp_close(rtsp_session->s);
free(server); free(server);