* asf.c : ASFv01 file input module for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
- * $Id: asf.c,v 1.34 2003/08/18 19:18:47 fenrir Exp $
+ * $Id: asf.c,v 1.35 2003/08/22 20:32:27 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
p_sys->i_data_begin = p_sys->p_root->p_data->i_object_pos + 50;
if( p_sys->p_root->p_data->i_object_size != 0 )
- { // local file
+ { /* local file */
p_sys->i_data_end = p_sys->p_root->p_data->i_object_pos +
p_sys->p_root->p_data->i_object_size;
}
else
- { // live/broacast
+ { /* live/broacast */
p_sys->i_data_end = -1;
}
- // go to first packet
- stream_Control( p_sys->s, STREAM_SET_POSITION, (int64_t)p_sys->i_data_begin );
+ /* go to first packet */
+ stream_Seek( p_sys->s, p_sys->i_data_begin );
/* try to calculate movie time */
if( p_sys->p_fp->i_data_packets_count > 0 )
{
int64_t i_count;
- int64_t i_size;
+ int64_t i_size = stream_Tell( p_sys->s );
- stream_Control( p_sys->s, STREAM_GET_SIZE, &i_size );
if( p_sys->i_data_end > 0 && i_size > p_sys->i_data_end )
{
i_size = p_sys->i_data_end;
msleep( p_input->i_pts_delay );
- stream_Control( p_sys->s, STREAM_GET_POSITION, &i_offset );
- i_offset -= p_sys->i_data_begin;
+ i_offset = stream_Tell( p_sys->s ) - p_sys->i_data_begin;
if( i_offset < 0 )
{
i_offset = 0;
{
i_offset -= i_offset % p_sys->p_fp->i_min_data_packet_size;
}
- i_offset += p_sys->i_data_begin;
- if( stream_Control( p_sys->s, STREAM_SET_POSITION, i_offset ) )
+ if( stream_Seek( p_sys->s, i_offset + p_sys->i_data_begin ) )
{
msg_Warn( p_input, "cannot resynch after seek (EOF?)" );
return -1;
* libasf.c :
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: libasf.c,v 1.15 2003/08/18 19:18:47 fenrir Exp $
+ * $Id: libasf.c,v 1.16 2003/08/22 20:32:27 fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
}
ASF_GetGUID( &p_common->i_object_id, p_peek );
p_common->i_object_size = GetQWLE( p_peek + 16 );
- stream_Control( s, STREAM_GET_POSITION, &p_common->i_object_pos );
+ p_common->i_object_pos = stream_Tell( s );
p_common->p_next = NULL;
#ifdef ASF_DEBUG
msg_Dbg( (vlc_object_t*)s,
}
- return( stream_Control( s, STREAM_SET_POSITION,
- p_obj->common.i_object_pos + p_obj->common.i_object_size ) );
+ return stream_Seek( s,
+ p_obj->common.i_object_pos +
+ p_obj->common.i_object_size );
}
static void ASF_FreeObject_Null( asf_object_t *pp_obj )
p_root->i_type = ASF_OBJECT_TYPE_ROOT;
memcpy( &p_root->i_object_id, &asf_object_null_guid, sizeof( guid_t ) );
p_root->i_object_pos = 0;
- stream_Control( s, STREAM_GET_SIZE, &p_root->i_object_size );
+ p_root->i_object_size = stream_Tell( s );
p_root->p_first = NULL;
p_root->p_last = NULL;
p_root->p_next = NULL;
* au.c : au file input module for vlc
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
- * $Id: au.c,v 1.4 2003/08/17 23:02:52 fenrir Exp $
+ * $Id: au.c,v 1.5 2003/08/22 20:32:27 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
if( p_input->stream.p_selected_program->i_synchro_state == SYNCHRO_REINIT )
{
- int64_t i_pos;
+ int64_t i_pos = stream_Tell( p_sys->s );
- stream_Control( p_sys->s, STREAM_GET_POSITION, &i_pos );
if( p_sys->wf.nBlockAlign != 0 )
{
i_pos += p_sys->wf.nBlockAlign - i_pos % p_sys->wf.nBlockAlign;
- if( stream_Control( p_sys->s, STREAM_SET_POSITION, i_pos ) )
+ if( stream_Seek( p_sys->s, i_pos ) )
{
- msg_Err( p_input, "STREAM_SET_POSITION failed (cannot resync)" );
+ msg_Err( p_input, "Seek failed(cannot resync)" );
}
}
}
* wav.c : wav file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: wav.c,v 1.4 2003/08/18 00:17:44 fenrir Exp $
+ * $Id: wav.c,v 1.5 2003/08/22 20:32:27 fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
goto error;
}
- stream_Control( p_sys->s, STREAM_GET_POSITION, &p_sys->i_data_pos );
+ p_sys->i_data_pos = stream_Tell( p_sys->s );
stream_Read( p_sys->s, NULL, 8 ); /* cannot fail */
if( p_input->stream.p_selected_program->i_synchro_state == SYNCHRO_REINIT )
{
- stream_Control( p_sys->s, STREAM_GET_POSITION, &i_pos );
+ i_pos = stream_Tell( p_sys->s );
if( p_sys->p_wf->nBlockAlign != 0 )
{
i_pos += p_sys->p_wf->nBlockAlign - i_pos % p_sys->p_wf->nBlockAlign;
- if( stream_Control( p_sys->s, STREAM_SET_POSITION, i_pos ) )
+ if( stream_Seek( p_sys->s, i_pos ) )
{
- msg_Err( p_input, "STREAM_SET_POSITION failed (cannot resync)" );
+ msg_Err( p_input, "stream_Sekk failed (cannot resync)" );
}
}
}
p_input->stream.p_selected_program,
p_sys->i_time * 9 / 100 );
- stream_Control( p_sys->s, STREAM_GET_POSITION, &i_pos );
+ i_pos = stream_Tell( p_sys->s );
if( p_sys->i_data_size > 0 &&
i_pos >= p_sys->i_data_pos + p_sys->i_data_size )