From 2c17f86019da1b19e752360049a1d0c53c2ec559 Mon Sep 17 00:00:00 2001 From: Pierre Ynard Date: Mon, 7 Mar 2011 04:34:26 +0100 Subject: [PATCH] vod_rtsp: fix raw transport without x-playNow header There have been reports about this. Untested --- modules/misc/rtsp.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/misc/rtsp.c b/modules/misc/rtsp.c index 54e3a26f2f..98999db272 100644 --- a/modules/misc/rtsp.c +++ b/modules/misc/rtsp.c @@ -113,6 +113,7 @@ typedef struct char *psz_session; bool b_playing; /* is it in "play" state */ + int i_port_raw; int i_es; rtsp_client_es_t **es; @@ -951,7 +952,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; @@ -982,8 +982,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" ) ) @@ -1047,6 +1047,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", @@ -1165,7 +1167,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 -- 2.39.2