/*****************************************************************************
* mmsh.c:
*****************************************************************************
- * Copyright (C) 2001, 2002 VideoLAN
+ * Copyright (C) 2001, 2002 the VideoLAN team
* $Id$
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
vlc_bool_t *pb_bool;
int *pi_int;
int64_t *pi_64;
+ 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;
/* */
*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_SET_PAUSE_STATE:
case ACCESS_GET_TITLE_INFO:
}
/* 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 )
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;