/*****************************************************************************
* mmsh.c:
*****************************************************************************
- * Copyright (C) 2001, 2002 VideoLAN
+ * Copyright (C) 2001, 2002 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
{
access_sys_t *p_sys;
char *psz_location = NULL;
- vlc_value_t val;
/* init p_sys */
p_access->info.i_size = p_sys->asfh.i_file_size;
}
- /* Update default_pts to a suitable value for mms access */
- var_Get( p_access, "mms-caching", &val );
-
return VLC_SUCCESS;
}
vlc_bool_t *pb_bool;
int *pi_int;
int64_t *pi_64;
- vlc_value_t val;
+ int i_int;
switch( i_query )
{
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
*pb_bool = !p_sys->b_broadcast;
break;
+
case ACCESS_CAN_FASTSEEK:
case ACCESS_CAN_PAUSE:
+ pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
+ *pb_bool = VLC_FALSE;
+ break;
+
case ACCESS_CAN_CONTROL_PACE:
pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t* );
+
+#if 0 /* Disable for now until we have a clock synchro algo
+ * which works with something else than MPEG over UDP */
*pb_bool = VLC_FALSE;
+#endif
+ *pb_bool = VLC_TRUE;
break;
/* */
case ACCESS_GET_PTS_DELAY:
pi_64 = (int64_t*)va_arg( args, int64_t * );
- var_Get( p_access, "mms-caching", &val );
- *pi_64 = val.i_int * 1000;
+ *pi_64 = (int64_t)var_GetInteger( p_access, "mms-caching" ) * I64C(1000);
+ break;
+
+ case ACCESS_GET_PRIVATE_ID_STATE:
+ i_int = (int)va_arg( args, int );
+ pb_bool = (vlc_bool_t*)va_arg( args, vlc_bool_t );
+
+ if( i_int < 0 || i_int > 127 )
+ return VLC_EGENERIC;
+ *pb_bool = p_sys->asfh.stream[i_int].i_selected ? VLC_TRUE : VLC_FALSE;
break;
/* */
case ACCESS_GET_TITLE_INFO:
case ACCESS_SET_TITLE:
case ACCESS_SET_SEEKPOINT:
+ case ACCESS_SET_PRIVATE_ID_STATE:
return VLC_EGENERIC;
default:
- msg_Err( p_access, "unimplemented query in control" );
+ msg_Warn( p_access, "unimplemented query in control" );
return VLC_EGENERIC;
}
if( ( p_sys->fd = net_OpenTCP( p_access, p_sys->url.psz_host,
p_sys->url.i_port ) ) < 0 )
{
- msg_Err( p_access, "cannot connect to%s:%d", p_sys->url.psz_host, p_sys->url.i_port );
+ msg_Err( p_access, "cannot connect to %s:%d", p_sys->url.psz_host, p_sys->url.i_port );
goto error;
}
/* send first request */
- net_Printf( VLC_OBJECT(p_access), p_sys->fd,
+ net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
"GET %s HTTP/1.0\r\n"
"Accept: */*\r\n"
"User-Agent: NSPlayer/4.1.0.3856\r\n"
p_sys->i_request_context++,
GUID_PRINT( p_sys->guid ) );
- if( net_Printf( VLC_OBJECT(p_access), p_sys->fd, "\r\n" ) < 0 )
+ if( net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL, "\r\n" ) < 0 )
{
msg_Err( p_access, "failed to send request" );
goto error;
}
/* Receive the http header */
- if( ( psz = net_Gets( VLC_OBJECT(p_access), p_sys->fd ) ) == NULL )
+ if( ( psz = net_Gets( VLC_OBJECT(p_access), p_sys->fd, NULL ) ) == NULL )
{
msg_Err( p_access, "failed to read answer" );
goto error;
free( psz );
for( ;; )
{
- char *psz = net_Gets( p_access, p_sys->fd );
+ char *psz = net_Gets( p_access, p_sys->fd, NULL );
char *p;
if( psz == NULL )
p_sys->asfh.i_min_data_packet_size );
E_( asf_StreamSelect)( &p_sys->asfh,
- config_GetInt( p_access, "mms-maxbitrate" ),
- config_GetInt( p_access, "mms-all" ),
- config_GetInt( p_access, "audio" ),
- config_GetInt( p_access, "video" ) );
+ var_CreateGetInteger( p_access, "mms-maxbitrate" ),
+ var_CreateGetInteger( p_access, "mms-all" ),
+ var_CreateGetInteger( p_access, "audio" ),
+ var_CreateGetInteger( p_access, "video" ) );
return VLC_SUCCESS;
msg_Err( p_access, "no stream selected" );
return VLC_EGENERIC;
}
- net_Printf( VLC_OBJECT(p_access), p_sys->fd,
+ net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
"GET %s HTTP/1.0\r\n"
"Accept: */*\r\n"
"User-Agent: NSPlayer/4.1.0.3856\r\n"
p_sys->url.psz_host, p_sys->url.i_port );
if( p_sys->b_broadcast )
{
- net_Printf( VLC_OBJECT(p_access), p_sys->fd,
+ net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
"Pragma: no-cache,rate=1.000000,request-context=%d\r\n",
p_sys->i_request_context++ );
}
else
{
- net_Printf( VLC_OBJECT(p_access), p_sys->fd,
+ net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
"Pragma: no-cache,rate=1.000000,stream-time=0,stream-offset=%u:%u,request-context=%d,max-duration=0\r\n",
(uint32_t)((i_pos >> 32)&0xffffffff),
(uint32_t)(i_pos&0xffffffff),
p_sys->i_request_context++ );
}
- net_Printf( VLC_OBJECT(p_access), p_sys->fd,
+ net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
"Pragma: xPlayStrm=1\r\n"
"Pragma: xClientGUID={"GUID_FMT"}\r\n"
"Pragma: stream-switch-count=%d\r\n"
i_select = 0;
}
- net_Printf( VLC_OBJECT(p_access), p_sys->fd,
+ net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
"ffff:%d:%d ", i, i_select );
}
}
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, "\r\n" );
- net_Printf( VLC_OBJECT(p_access), p_sys->fd, "Connection: Close\r\n" );
+ net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL, "\r\n" );
+ net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL,
+ "Connection: Close\r\n" );
- if( net_Printf( VLC_OBJECT(p_access), p_sys->fd, "\r\n" ) < 0 )
+ if( net_Printf( VLC_OBJECT(p_access), p_sys->fd, NULL, "\r\n" ) < 0 )
{
msg_Err( p_access, "failed to send request" );
return VLC_EGENERIC;
}
- if( ( psz = net_Gets( VLC_OBJECT(p_access), p_sys->fd ) ) == NULL )
+ if( ( psz = net_Gets( VLC_OBJECT(p_access), p_sys->fd, NULL ) ) == NULL )
{
msg_Err( p_access, "cannot read data" );
return VLC_EGENERIC;
/* FIXME check HTTP code */
for( ;; )
{
- char *psz = net_Gets( p_access, p_sys->fd );
+ char *psz = net_Gets( p_access, p_sys->fd, NULL );
if( psz == NULL )
{
msg_Err( p_access, "cannot read data" );
memset( p_ck, 0, sizeof( chunk_t ) );
/* Read the chunk header */
- if( net_Read( p_access, p_sys->fd, p_sys->buffer, 12, VLC_TRUE ) < 12 )
+ if( net_Read( p_access, p_sys->fd, NULL, p_sys->buffer, 12, VLC_TRUE ) < 12 )
{
/* msg_Err( p_access, "cannot read data" ); */
return VLC_EGENERIC;
}
if( p_ck->i_data > 0 &&
- net_Read( p_access, p_sys->fd, &p_sys->buffer[12], p_ck->i_data, VLC_TRUE ) < p_ck->i_data )
+ net_Read( p_access, p_sys->fd, NULL, &p_sys->buffer[12], p_ck->i_data, VLC_TRUE ) < p_ck->i_data )
{
msg_Err( p_access, "cannot read data" );
return VLC_EGENERIC;