summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorlu_zero <lu_zero@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-06-25 09:53:45 +0000
committerlu_zero <lu_zero@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-06-25 09:53:45 +0000
commit401c4717b973bfd729513f1b1f0db27c78c48367 (patch)
tree3ea5c7a037f5acab4dbf38b395cc5b7ba9023ad3 /stream
parent57488ffeed4768476f27299978478587c7ebabe3 (diff)
downloadmpv-401c4717b973bfd729513f1b1f0db27c78c48367.tar.bz2
mpv-401c4717b973bfd729513f1b1f0db27c78c48367.tar.xz
Move rtsp_close away by simplification - avoids symbol clash with libnemesi
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27135 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/librtsp/rtsp.c42
-rw-r--r--stream/librtsp/rtsp.h1
-rw-r--r--stream/librtsp/rtsp_session.c23
3 files changed, 33 insertions, 33 deletions
diff --git a/stream/librtsp/rtsp.c b/stream/librtsp/rtsp.c
index 16a77f77d5..ca5e16d39b 100644
--- a/stream/librtsp/rtsp.c
+++ b/stream/librtsp/rtsp.c
@@ -575,14 +575,22 @@ int rtsp_read_data(rtsp_t *s, char *buffer, unsigned int size) {
//rtsp_t *rtsp_connect(const char *mrl, const char *user_agent) {
rtsp_t *rtsp_connect(int fd, char* mrl, char *path, char *host, int port, char *user_agent) {
- rtsp_t *s=malloc(sizeof(rtsp_t));
+ rtsp_t *s;
int i;
-
+
+ if (fd < 0) {
+ mp_msg(MSGT_OPEN, MSGL_ERR, "rtsp: failed to connect to '%s'\n", host);
+ return NULL;
+ }
+
+ s = malloc(sizeof(rtsp_t));
+
for (i=0; i<MAX_FIELDS; i++) {
s->answers[i]=NULL;
s->scheduled[i]=NULL;
}
+ s->s = fd;
s->server=NULL;
s->server_state=0;
s->server_caps=0;
@@ -605,13 +613,6 @@ rtsp_t *rtsp_connect(int fd, char* mrl, char *path, char *host, int port, char *
s->param++;
//mp_msg(MSGT_OPEN, MSGL_INFO, "path=%s\n", s->path);
//mp_msg(MSGT_OPEN, MSGL_INFO, "param=%s\n", s->param ? s->param : "NULL");
- s->s = fd;
-
- if (s->s < 0) {
- mp_msg(MSGT_OPEN, MSGL_ERR, "rtsp: failed to connect to '%s'\n", s->host);
- rtsp_close(s);
- return NULL;
- }
s->server_state=RTSP_CONNECTED;
@@ -632,29 +633,6 @@ rtsp_t *rtsp_connect(int fd, char* mrl, char *path, char *host, int port, char *
/*
- * closes an rtsp connection
- */
-
-void rtsp_close(rtsp_t *s) {
-
- if (s->server_state)
- {
- if (s->server_state == RTSP_PLAYING)
- rtsp_request_teardown (s, NULL);
- closesocket (s->s);
- }
-
- if (s->path) free(s->path);
- if (s->host) free(s->host);
- if (s->mrl) free(s->mrl);
- if (s->session) free(s->session);
- if (s->user_agent) free(s->user_agent);
- rtsp_free_answers(s);
- rtsp_unschedule_all(s);
- free(s);
-}
-
-/*
* search in answers for tags. returns a pointer to the content
* after the first matched tag. returns NULL if no match found.
*/
diff --git a/stream/librtsp/rtsp.h b/stream/librtsp/rtsp.h
index 528dacaa42..352ac7ac82 100644
--- a/stream/librtsp/rtsp.h
+++ b/stream/librtsp/rtsp.h
@@ -66,7 +66,6 @@ void rtsp_add_to_payload(char **payload, const char *string);
void rtsp_free_answers(rtsp_t *this);
int rtsp_read (rtsp_t *this, char *data, int len);
-void rtsp_close (rtsp_t *this);
void rtsp_set_session(rtsp_t *s, const char *id);
char *rtsp_get_session(rtsp_t *s);
diff --git a/stream/librtsp/rtsp_session.c b/stream/librtsp/rtsp_session.c
index a3559212b2..e5ee55893d 100644
--- a/stream/librtsp/rtsp_session.c
+++ b/stream/librtsp/rtsp_session.c
@@ -73,6 +73,29 @@ struct rtsp_session_s {
struct rtp_rtsp_session_t* rtp_session;
};
+/*
+ * closes an rtsp connection
+ */
+
+static void rtsp_close(rtsp_t *s) {
+
+ if (s->server_state)
+ {
+ if (s->server_state == RTSP_PLAYING)
+ rtsp_request_teardown (s, NULL);
+ closesocket (s->s);
+ }
+
+ if (s->path) free(s->path);
+ if (s->host) free(s->host);
+ if (s->mrl) free(s->mrl);
+ if (s->session) free(s->session);
+ if (s->user_agent) free(s->user_agent);
+ rtsp_free_answers(s);
+ rtsp_unschedule_all(s);
+ free(s);
+}
+
//rtsp_session_t *rtsp_session_start(char *mrl) {
rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host,
int port, int *redir, uint32_t bandwidth, char *user, char *pass) {