/* Refill a block */
if( AStreamRefillBlock( s ) )
- {
- msg_Err( s, "cannot pre fill buffer" );
return VLC_EGENERIC;
- }
+
/* Update stat */
p_sys->stat.i_seek_time += i_end - i_start;
p_sys->stat.i_seek_count++;
else
{
/* Read enough data */
- while( p_sys->block.i_start + p_sys->block.i_size < i_pos )
+ while( p_sys->block.i_start + p_sys->block.i_size <= i_pos )
{
if( AStreamRefillBlock( s ) )
- {
- msg_Err( s, "can't read enough data in seek" );
return VLC_EGENERIC;
- }
+
while( p_sys->block.p_current &&
- p_sys->i_pos + p_sys->block.p_current->i_buffer < i_pos )
+ p_sys->i_pos + p_sys->block.p_current->i_buffer <= i_pos )
{
p_sys->i_pos += p_sys->block.p_current->i_buffer;
p_sys->block.p_current = p_sys->block.p_current->p_next;
p_sys->block.i_offset = i_pos - p_sys->i_pos;
p_sys->i_pos = i_pos;
- /* TODO read data */
return VLC_SUCCESS;
}