Commit 09cbae7e authored by Gildas Bazin's avatar Gildas Bazin

* ALL: p_selected_area->i_tell is now update inside input_SplitBuffer instead
   of inside the pf_read functions of access plugins. That means i_tell now
   actually reflects the position of what is being decoded and furthermore it
   is updated more often.
parent f068c802
......@@ -8,7 +8,7 @@
* -udf.* to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: access.c,v 1.2 2002/08/07 00:29:36 sam Exp $
* $Id: access.c,v 1.3 2002/10/26 15:24:19 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -555,14 +555,13 @@ static ssize_t DVDRead( input_thread_t * p_input,
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.p_selected_area->i_tell += LB2OFF( i_read );
if( p_dvd->b_new_chapter )
{
p_input->stream.p_selected_area->i_part = p_dvd->i_chapter;
p_dvd->b_new_chapter = 0;
}
if( ( p_input->stream.p_selected_area->i_tell
if( ( p_input->stream.p_selected_area->i_tell + LB2OFF( i_read )
>= p_input->stream.p_selected_area->i_size )
|| ( i_block_once <= 0 ) )
{
......
......@@ -2,7 +2,7 @@
* access.c: access capabilities for dvdplay plugin.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: access.c,v 1.3 2002/08/29 23:53:22 massiot Exp $
* $Id: access.c,v 1.4 2002/10/26 15:24:19 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -304,19 +304,13 @@ static int dvdplay_Read( input_thread_t * p_input,
{
dvd_data_t * p_dvd;
off_t i_read;
p_dvd = (dvd_data_t *)p_input->p_access_data;
vlc_mutex_lock( &p_input->stream.stream_lock );
i_read = LB2OFF( dvdplay_read( p_dvd->vmg, p_buffer, OFF2LB( i_count ) ) );
p_input->stream.p_selected_area->i_tell =
LB2OFF( dvdplay_position( p_dvd->vmg ) ) -
p_input->stream.p_selected_area->i_start;
vlc_mutex_unlock( &p_input->stream.stream_lock );
return i_read;
}
......@@ -334,9 +328,13 @@ static void dvdplay_Seek( input_thread_t * p_input, off_t i_off )
p_dvd = (dvd_data_t *)p_input->p_access_data;
vlc_mutex_lock( &p_input->stream.stream_lock );
dvdplay_seek( p_dvd->vmg, OFF2LB( i_off ) );
p_input->stream.p_selected_area->i_tell =
LB2OFF( dvdplay_position( p_dvd->vmg ) ) -
p_input->stream.p_selected_area->i_start;
vlc_mutex_unlock( &p_input->stream.stream_lock );
return;
......@@ -477,6 +475,7 @@ static int dvdNewPGC( input_thread_t * p_input )
p_input->stream.p_selected_area->i_size =
LB2OFF( dvdplay_title_end ( p_dvd->vmg ) ) -
p_input->stream.p_selected_area->i_start;
p_input->stream.p_selected_area->i_tell = 0;
if( p_input->stream.p_selected_area->i_size > 0 )
{
......
......@@ -6,7 +6,7 @@
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: input.c,v 1.5 2002/10/23 21:54:33 gbazin Exp $
* $Id: input.c,v 1.6 2002/10/26 15:24:19 gbazin Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -930,10 +930,6 @@ static int DvdReadRead( input_thread_t * p_input,
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.p_selected_area->i_tell =
LB2OFF( p_dvd->i_cur_block ) -
p_input->stream.p_selected_area->i_start;
if( p_dvd->b_eoc )
{
/* We modify i_part only at end of chapter not to erase
......@@ -942,7 +938,8 @@ static int DvdReadRead( input_thread_t * p_input,
p_dvd->b_eoc = 0;
}
if( p_input->stream.p_selected_area->i_tell
if( ( LB2OFF( p_dvd->i_cur_block )
- p_input->stream.p_selected_area->i_start )
>= p_input->stream.p_selected_area->i_size || b_eot )
{
if( ( p_input->stream.p_selected_area->i_id + 1 ) >=
......
......@@ -2,7 +2,7 @@
* vcd.c : VCD input module for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: vcd.c,v 1.8 2002/10/16 11:35:53 sam Exp $
* $Id: vcd.c,v 1.9 2002/10/26 15:24:19 gbazin Exp $
*
* Author: Johan Bilien <jobi@via.ecp.fr>
*
......@@ -315,10 +315,6 @@ static int VCDRead( input_thread_t * p_input, byte_t * p_buffer,
p_last_sector, i_len % VCD_DATA_SIZE );
i_read += i_len % VCD_DATA_SIZE;
}
p_input->stream.p_selected_area->i_tell =
(off_t)p_vcd->i_sector * (off_t)VCD_DATA_SIZE
- p_input->stream.p_selected_area->i_start;
return i_read;
}
......
......@@ -2,7 +2,7 @@
* input_ext-plugins.c: useful functions for access and demux plug-ins
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: input_ext-plugins.c,v 1.18 2002/07/31 20:56:52 sam Exp $
* $Id: input_ext-plugins.c,v 1.19 2002/10/26 15:24:19 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -613,6 +613,11 @@ ssize_t input_SplitBuffer( input_thread_t * p_input,
p_input->p_current_data += i_size;
/* Update stream position */
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.p_selected_area->i_tell += i_size;
vlc_mutex_unlock( &p_input->stream.stream_lock );
return( i_size );
}
......@@ -706,13 +711,6 @@ ssize_t input_FDRead( input_thread_t * p_input, byte_t * p_buffer, size_t i_len
ssize_t i_ret = read( p_access_data->i_handle, p_buffer, i_len );
if( i_ret > 0 )
{
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.p_selected_area->i_tell += i_ret;
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
if( i_ret < 0 )
{
msg_Err( p_input, "read failed (%s)", strerror(errno) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment