[vlc-commits] vod_rtsp: fix raw transport without x-playNow header

Pierre Ynard git at videolan.org
Mon Mar 7 04:43:20 CET 2011


vlc/vlc-1.1 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Mon Mar  7 04:34:26 2011 +0100| [423f1b08da1c4b3c437b7e95b62a3402c9208d13] | committer: Pierre Ynard

vod_rtsp: fix raw transport without x-playNow header

There have been reports about this. Untested

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=423f1b08da1c4b3c437b7e95b62a3402c9208d13
---

 modules/misc/rtsp.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/misc/rtsp.c b/modules/misc/rtsp.c
index 2a5b8e6..c94cfbb 100644
--- a/modules/misc/rtsp.c
+++ b/modules/misc/rtsp.c
@@ -114,6 +114,7 @@ typedef struct
 
     bool b_playing; /* is it in "play" state */
     bool b_paused; /* is it in "pause" state */
+    int i_port_raw;
 
     int i_es;
     rtsp_client_es_t **es;
@@ -981,7 +982,6 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
     const char *psz_session = NULL;
     const char *psz_cseq = NULL;
     rtsp_client_t *p_rtsp;
-    int i_port = 0;
     int i_cseq = 0;
 
     if( answer == NULL || query == NULL ) return VLC_SUCCESS;
@@ -1012,8 +1012,8 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
             {
                 rtsp_client_t *p_rtsp = NULL;
                 char ip[NI_MAXNUMERICHOST];
-                i_port = atoi( strstr( psz_transport, "client_port=" ) +
-                                strlen("client_port=") );
+                int i_port = atoi( strstr( psz_transport, "client_port=" ) +
+                                   strlen("client_port=") );
 
                 if( strstr( psz_transport, "MP2T/H2221/UDP" ) ||
                     strstr( psz_transport, "RAW/RAW/UDP" ) )
@@ -1077,6 +1077,8 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
 
                 if( p_media->b_raw )
                 {
+                    p_rtsp->i_port_raw = i_port;
+
                     if( strstr( psz_transport, "MP2T/H2221/UDP" ) )
                     {
                         httpd_MsgAdd( answer, "Transport",
@@ -1209,7 +1211,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
                 {
                     if( asprintf( &psz_output,
                               "std{access=udp,dst=%s:%i,mux=%s}",
-                              ip, i_port, p_media->psz_mux ) < 0 )
+                              ip, p_rtsp->i_port_raw, p_media->psz_mux ) < 0 )
                         return VLC_ENOMEM;
                 }
                 else



More information about the vlc-commits mailing list