diff stream/librtsp/rtsp_session.c @ 27103:a3f6dc43b585

Move rtsp_close away by simplification - avoids symbol clash with libnemesi
author lu_zero
date Wed, 25 Jun 2008 09:53:45 +0000
parents 4401909aac98
children 83d160a30ca7
line wrap: on
line diff
--- a/stream/librtsp/rtsp_session.c	Tue Jun 24 22:36:56 2008 +0000
+++ b/stream/librtsp/rtsp_session.c	Wed Jun 25 09:53:45 2008 +0000
@@ -73,6 +73,29 @@
   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) {