* Preamble
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
#include <vlc_access.h>
#include "vlc_playlist.h"
int E_(MMSHOpen) ( access_t * );
void E_(MMSHClose) ( access_t * );
-static int Read( access_t *, uint8_t *, int );
-static int ReadRedirect( access_t *, uint8_t *, int );
+static ssize_t Read( access_t *, uint8_t *, size_t );
+static ssize_t ReadRedirect( access_t *, uint8_t *, size_t );
static int Seek( access_t *, int64_t );
static int Control( access_t *, int, va_list );
while( !p_access->b_die )
{
+ msg_Warn( p_access, "GetPacket 1" );
if( GetPacket( p_access, &ck ) )
break;
/*****************************************************************************
* Read:
*****************************************************************************/
-static int ReadRedirect( access_t *p_access, uint8_t *p, int i_len )
+static ssize_t ReadRedirect( access_t *p_access, uint8_t *p, size_t i_len )
{
- return VLC_SUCCESS;
+ return 0;
}
/*****************************************************************************
* Read:
*****************************************************************************/
-static int Read( access_t *p_access, uint8_t *p_buffer, int i_len )
+static ssize_t Read( access_t *p_access, uint8_t *p_buffer, size_t i_len )
{
access_sys_t *p_sys = p_access->p_sys;
size_t i_copy;
size_t i_data = 0;
if( p_access->info.b_eof )
- return VLC_SUCCESS;
+ return 0;
while( i_data < (size_t) i_len )
{
else
{
chunk_t ck;
+ msg_Warn( p_access, "GetPacket 2" );
if( GetPacket( p_access, &ck ) )
{
int i_ret = -1;
if( Describe( p_access, &psz_location ) )
{
msg_Err( p_access, "describe failed" );
- return VLC_ENGENERIC;
+ return VLC_EGENERIC;
}
/* */
if( Start( p_access, 0 ) )
{
msg_Err( p_access, "Start failed" );
- return VLC_ENGENERIC;
+ return VLC_EGENERIC;
}
return VLC_SUCCESS;
}
/* Get the next header FIXME memory loss ? */
GetHeader( p_access );
if( p_sys->i_header <= 0 )
- return VLC_ENGENERIC;
+ return VLC_EGENERIC;
E_( asf_HeaderParse )( &p_sys->asfh,
p_sys->p_header, p_sys->i_header );
/*****************************************************************************
* Start stream
- *****************************************************************************/
-static int Start( access_t *p_access, off_t i_pos )
+ ****************************************************************************/
+static int Start( access_t *p_access, int64_t i_pos )
{
access_sys_t *p_sys = p_access->p_sys;
int i_streams = 0;
psz = net_Gets( VLC_OBJECT(p_access), p_sys->fd, NULL );
if( psz == NULL )
{
- msg_Err( p_access, "cannot read data" );
+ msg_Err( p_access, "cannot read data 0" );
return VLC_EGENERIC;
}
char *psz = net_Gets( p_access, p_sys->fd, NULL );
if( psz == NULL )
{
- msg_Err( p_access, "cannot read data" );
+ msg_Err( p_access, "cannot read data 1" );
return VLC_EGENERIC;
}
if( *psz == '\0' )
* entire header.
*/
if( net_Read( p_access, p_sys->fd, NULL, p_sys->buffer, 4, VLC_TRUE ) < 4 )
+ {
+ msg_Err( p_access, "cannot read data 2" );
return VLC_EGENERIC;
+ }
p_ck->i_type = GetWLE( p_sys->buffer);
p_ck->i_size = GetWLE( p_sys->buffer + 2);
if( net_Read( p_access, p_sys->fd, NULL, p_sys->buffer + 4, restsize, VLC_TRUE ) < restsize )
{
- msg_Err( p_access, "cannot read data" );
+ msg_Err( p_access, "cannot read data 3" );
return VLC_EGENERIC;
}
p_ck->i_sequence = GetDWLE( p_sys->buffer + 4);
(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" );
+ msg_Err( p_access, "cannot read data 4" );
return VLC_EGENERIC;
}