summaryrefslogtreecommitdiffstats
path: root/stream/librtsp/rtsp_session.c
diff options
context:
space:
mode:
Diffstat (limited to 'stream/librtsp/rtsp_session.c')
-rw-r--r--stream/librtsp/rtsp_session.c23
1 files changed, 23 insertions, 0 deletions
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) {