[vlc-commits] core: replace vod_sys_t* by void*
Romain Vimont
git at videolan.org
Thu Apr 26 01:43:04 CEST 2018
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Tue Apr 24 09:41:03 2018 +0200| [79afb971ff3c1eada2d1217e2a1015cc56a321e4] | committer: Jean-Baptiste Kempf
core: replace vod_sys_t* by void*
See #17078
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=79afb971ff3c1eada2d1217e2a1015cc56a321e4
---
include/vlc_vod.h | 2 +-
modules/misc/rtsp.c | 32 +++++++++++++++++++-------------
modules/stream_out/vod.c | 3 ++-
3 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/include/vlc_vod.h b/include/vlc_vod.h
index 37fee2b810..6fb7ed0a8a 100644
--- a/include/vlc_vod.h
+++ b/include/vlc_vod.h
@@ -39,7 +39,7 @@ struct vod_t
/* Module properties */
module_t *p_module;
- vod_sys_t *p_sys;
+ void *p_sys;
vod_media_t * (*pf_media_new) ( vod_t *, const char *, input_item_t * );
void (*pf_media_del) ( vod_t *, vod_media_t * );
diff --git a/modules/misc/rtsp.c b/modules/misc/rtsp.c
index 74091f0718..d72fd5ba31 100644
--- a/modules/misc/rtsp.c
+++ b/modules/misc/rtsp.c
@@ -678,8 +678,9 @@ static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt )
return VLC_EGENERIC;
}
+ vod_sys_t *p_sys = p_vod->p_sys;
p_es->p_rtsp_url =
- httpd_UrlNew( p_vod->p_sys->p_rtsp_host, psz_urlc, NULL, NULL );
+ httpd_UrlNew( p_sys->p_rtsp_host, psz_urlc, NULL, NULL );
if( !p_es->p_rtsp_url )
{
@@ -760,7 +761,8 @@ static void CommandPush( vod_t *p_vod, rtsp_cmd_type_t i_type, vod_media_t *p_me
p_cmd = block_Alloc( sizeof(rtsp_cmd_t) );
memcpy( p_cmd->p_buffer, &cmd, sizeof(cmd) );
- block_FifoPut( p_vod->p_sys->p_fifo_cmd, p_cmd );
+ vod_sys_t *p_sys = p_vod->p_sys;
+ block_FifoPut( p_sys->p_fifo_cmd, p_cmd );
}
static void* CommandThread( void *obj )
@@ -868,9 +870,10 @@ static rtsp_client_t *RtspClientNew( vod_media_t *p_media, char *psz_session )
p_rtsp->psz_session = psz_session;
TAB_APPEND( p_media->i_rtsp, p_media->rtsp, p_rtsp );
- p_media->p_vod->p_sys->i_connections++;
+ vod_sys_t *p_sys = p_media->p_vod->p_sys;
+ p_sys->i_connections++;
msg_Dbg( p_media->p_vod, "new session: %s, connections: %d",
- psz_session, p_media->p_vod->p_sys->i_throttle_users );
+ psz_session, p_sys->i_throttle_users );
return p_rtsp;
}
@@ -888,9 +891,10 @@ static rtsp_client_t *RtspClientGet( vod_media_t *p_media, const char *psz_sessi
static void RtspClientDel( vod_media_t *p_media, rtsp_client_t *p_rtsp )
{
- p_media->p_vod->p_sys->i_connections--;
+ vod_sys_t *p_sys = p_media->p_vod->p_sys;
+ p_sys->i_connections--;
msg_Dbg( p_media->p_vod, "closing session: %s, connections: %d",
- p_rtsp->psz_session, p_media->p_vod->p_sys->i_throttle_users );
+ p_rtsp->psz_session, p_sys->i_throttle_users );
while( p_rtsp->i_es )
{
@@ -933,6 +937,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
{
vod_media_t *p_media = (vod_media_t*)p_args;
vod_t *p_vod = p_media->p_vod;
+ vod_sys_t *p_sys = p_vod->p_sys;
const char *psz_transport = NULL;
const char *psz_playnow = NULL; /* support option: x-playNow */
const char *psz_session = NULL;
@@ -974,7 +979,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
if( strstr( psz_transport, "MP2T/H2221/UDP" ) ||
strstr( psz_transport, "RAW/RAW/UDP" ) )
{
- p_media->psz_mux = p_vod->p_sys->psz_raw_mux;
+ p_media->psz_mux = p_sys->psz_raw_mux;
p_media->b_raw = true;
}
@@ -993,8 +998,8 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
if( !psz_session || !*psz_session )
{
char *psz_new;
- if( ( p_vod->p_sys->i_throttle_users > 0 ) &&
- ( p_vod->p_sys->i_connections >= p_vod->p_sys->i_throttle_users ) )
+ if( ( p_sys->i_throttle_users > 0 ) &&
+ ( p_sys->i_connections >= p_sys->i_throttle_users ) )
{
answer->i_status = 503;
answer->i_body = 0;
@@ -1252,9 +1257,9 @@ static int RtspCallback( httpd_callback_sys_t *p_args, httpd_client_t *cl,
if( psz_session )
{
- if( p_media->p_vod->p_sys->i_session_timeout >= 0 )
+ if( p_sys->i_session_timeout >= 0 )
httpd_MsgAdd( answer, "Session", "%s;timeout=%i", psz_session,
- p_media->p_vod->p_sys->i_session_timeout );
+ p_sys->i_session_timeout );
else
httpd_MsgAdd( answer, "Session", "%s", psz_session );
}
@@ -1269,6 +1274,7 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
media_es_t *p_es = (media_es_t*)p_args;
vod_media_t *p_media = p_es->p_media;
vod_t *p_vod = p_media->p_vod;
+ vod_sys_t *p_sys = p_vod->p_sys;
rtsp_client_t *p_rtsp = NULL;
const char *psz_transport = NULL;
const char *psz_playnow = NULL; /* support option: x-playNow */
@@ -1319,8 +1325,8 @@ static int RtspCallbackES( httpd_callback_sys_t *p_args, httpd_client_t *cl,
if( !psz_session || !*psz_session )
{
char *psz_new;
- if( ( p_vod->p_sys->i_throttle_users > 0 ) &&
- ( p_vod->p_sys->i_connections >= p_vod->p_sys->i_throttle_users ) )
+ if( ( p_sys->i_throttle_users > 0 ) &&
+ ( p_sys->i_connections >= p_sys->i_throttle_users ) )
{
answer->i_status = 503;
answer->i_body = 0;
diff --git a/modules/stream_out/vod.c b/modules/stream_out/vod.c
index 9db3d709f0..dce96ada9e 100644
--- a/modules/stream_out/vod.c
+++ b/modules/stream_out/vod.c
@@ -341,7 +341,8 @@ static void CommandPush( vod_t *p_vod, rtsp_cmd_type_t i_type,
p_cmd = block_Alloc( sizeof(rtsp_cmd_t) );
memcpy( p_cmd->p_buffer, &cmd, sizeof(cmd) );
- block_FifoPut( p_vod->p_sys->p_fifo_cmd, p_cmd );
+ vod_sys_t *p_sys = p_vod->p_sys;
+ block_FifoPut( p_sys->p_fifo_cmd, p_cmd );
}
static void* CommandThread( void *obj )
More information about the vlc-commits
mailing list