[Mplayer-cvslog] CVS: main/libmpdemux/realrtsp rtsp_session.c,1.2,1.3 rtsp_session.h,1.1,1.2

Roberto Togni CVS rtognimp at mplayerhq.hu
Wed May 28 23:40:56 CEST 2003


Update of /cvsroot/mplayer/main/libmpdemux/realrtsp
In directory mail:/var/tmp.root/cvs-serv10659/realrtsp

Modified Files:
	rtsp_session.c rtsp_session.h 
Log Message:
Fix redirection in real rtsp connections.
Patch by yepyep (sdpplin.c part not committed)



Index: rtsp_session.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/realrtsp/rtsp_session.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- rtsp_session.c	27 May 2003 19:58:28 -0000	1.2
+++ rtsp_session.c	28 May 2003 21:40:53 -0000	1.3
@@ -65,7 +65,7 @@
 };
 
 //rtsp_session_t *rtsp_session_start(char *mrl) {
-rtsp_session_t *rtsp_session_start(int fd, char *mrl, char *path, char *host, int port) {
+rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host, int port, int *redir) {
 
   rtsp_session_t *rtsp_session=malloc(sizeof(rtsp_session_t));
   char *server;
@@ -73,10 +73,11 @@
   rmff_header_t *h;
   uint32_t bandwidth=10485800;
 
-connect:
+//connect:
+  *redir = 0;
 
   /* connect to server */
-  rtsp_session->s=rtsp_connect(fd,mrl,path,host,port,NULL);
+  rtsp_session->s=rtsp_connect(fd,*mrl,path,host,port,NULL);
   if (!rtsp_session->s)
   {
     printf("rtsp_session: failed to connect to server %s\n", path);
@@ -107,8 +108,13 @@
         printf("rtsp_session: redirected to %s\n", mrl_line);
 	rtsp_close(rtsp_session->s);
 	free(server);
-  /* FIXME: this won't work in MPlayer, connection opened by caller */
-	goto connect; /* *shudder* i made a design mistake somewhere */
+        free(*mrl);
+        free(rtsp_session);
+        /* tell the caller to redirect, return url to redirect to in mrl */
+        *mrl = mrl_line;
+        *redir = 1;
+        return NULL;
+//	goto connect; /* *shudder* i made a design mistake somewhere */
       } else
       {
         printf("rtsp_session: session can not be established.\n");

Index: rtsp_session.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/realrtsp/rtsp_session.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- rtsp_session.h	17 Apr 2003 20:38:57 -0000	1.1
+++ rtsp_session.h	28 May 2003 21:40:53 -0000	1.2
@@ -30,7 +30,7 @@
 
 typedef struct rtsp_session_s rtsp_session_t;
 
-rtsp_session_t *rtsp_session_start(int fd, char *mrl, char *path, char *host, int port);
+rtsp_session_t *rtsp_session_start(int fd, char **mrl, char *path, char *host, int port, int *redir);
 
 int rtsp_session_read(rtsp_session_t *session, char *data, int len);
 



More information about the MPlayer-cvslog mailing list