Commit 616a010c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

access: reset EOF implicitly on succesful seek

parent 2381c5b8
......@@ -142,9 +142,13 @@ VLC_API void vlc_access_Delete(access_t *access);
*/
static inline int vlc_access_Seek(access_t *access, uint64_t offset)
{
if (access->pf_seek == NULL)
return VLC_EGENERIC;
return access->pf_seek(access, offset);
int ret = VLC_EGENERIC;
if (access->pf_seek != NULL)
ret = access->pf_seek(access, offset);
if (ret == VLC_SUCCESS)
access->info.b_eof = false;
return ret;
}
/**
......
......@@ -136,7 +136,6 @@ static int Seek(access_t *access, uint64_t position)
position = a->i_data;
sys->offset = position;
access->info.b_eof = false;
return VLC_SUCCESS;
}
......
......@@ -373,7 +373,6 @@ static int Seek(access_t *access, uint64_t position)
if (sys->size < 0 || position != sys->size)
return VLC_EGENERIC;
}
access->info.b_eof = false;
return VLC_SUCCESS;
}
......
......@@ -450,8 +450,6 @@ static int Seek( access_t *p_access, uint64_t i_pos )
if (smb_fseek(p_sys->p_session, p_sys->i_fd, i_pos, SMB_SEEK_SET) == -1)
return VLC_EGENERIC;
p_access->info.b_eof = false;
return VLC_SUCCESS;
}
......
......@@ -304,8 +304,6 @@ static ssize_t Read (access_t *p_access, void *p_buffer, size_t i_len)
*****************************************************************************/
static int FileSeek (access_t *p_access, uint64_t i_pos)
{
p_access->info.b_eof = false;
if (lseek (p_access->p_sys->fd, i_pos, SEEK_SET) == (off_t)-1)
return VLC_EGENERIC;
return VLC_SUCCESS;
......
......@@ -829,7 +829,6 @@ static int Seek( access_t *p_access, uint64_t i_pos )
if( val )
return val;
p_access->info.b_eof = false;
p_sys->offset = i_pos;
return VLC_SUCCESS;
......
......@@ -660,7 +660,6 @@ static int Seek( access_t *p_access, uint64_t i_pos )
if( retval == VLC_SUCCESS ) {
uint8_t p_buffer[2];
Read( p_access, p_buffer, 1);
p_access->info.b_eof = false;
}
return retval;
}
......
......@@ -56,7 +56,6 @@ static block_t *FileRead(access_t *access, bool *restrict eof)
static int FileSeek(access_t *access, uint64_t pos)
{
access_sys_t *sys = access->p_sys;
access->info.b_eof = false;
if (vlc_http_file_seek(sys->resource, pos))
return VLC_EGENERIC;
......
......@@ -62,8 +62,6 @@ static int Seek(access_t *access, uint64_t offset)
if (sys->seek_cb(sys->opaque, offset) != 0)
return VLC_EGENERIC;
access->info.b_eof = false;
return VLC_SUCCESS;
}
......
......@@ -329,7 +329,6 @@ static int Seek( access_t *p_access, uint64_t i_pos )
}
p_sys->i_position = i_pos;
p_access->info.b_eof = false;
p_sys->i_packet_used += i_offset;
return VLC_SUCCESS;
......
......@@ -417,7 +417,6 @@ static int Seek( access_t * p_access, uint64_t i_pos )
p_sys->i_media_used += i_offset;
p_sys->i_position = i_pos;
p_access->info.b_eof = false;
return VLC_SUCCESS;
}
......
......@@ -211,8 +211,6 @@ static ssize_t Read( access_t *p_access, void *p_buffer, size_t i_len )
*****************************************************************************/
static int Seek( access_t *p_access, uint64_t i_pos )
{
p_access->info.b_eof = false;
if (lseek( p_access->p_sys->fd, i_pos, SEEK_SET ) == (off_t)-1)
return VLC_EGENERIC;
return VLC_SUCCESS;
......
......@@ -243,7 +243,6 @@ static int
FileSeek(access_t *p_access, uint64_t i_pos)
{
access_sys_t *p_sys = p_access->p_sys;
p_access->info.b_eof = false;
p_sys->res.seek.b_done = false;
if (nfs_lseek_async(p_sys->p_nfs, p_sys->p_nfsfh, i_pos, SEEK_SET,
......
......@@ -59,7 +59,6 @@ static int Seek(access_t *access, uint64_t position)
if (position < sys->chunk->cummulated_size + sys->chunk->size)
break;
}
access->info.b_eof = false;
const uint64_t offset = sys->chunk->offset +
(position - sys->chunk->cummulated_size);
......
......@@ -107,7 +107,6 @@ static int Seek (access_t *access, uint64_t position)
position = sys->length;
sys->offset = position;
access->info.b_eof = false;
return VLC_SUCCESS;
}
......
......@@ -407,8 +407,6 @@ static ssize_t Read( access_t *p_access, void *buf, size_t len )
static int Seek( access_t* p_access, uint64_t i_pos )
{
p_access->info.b_eof = false;
libssh2_sftp_seek( p_access->p_sys->file, i_pos );
return VLC_SUCCESS;
}
......
......@@ -312,8 +312,6 @@ static int Seek( access_t *p_access, uint64_t i_pos )
return VLC_EGENERIC;
}
p_access->info.b_eof = false;
return VLC_SUCCESS;
}
......
......@@ -426,9 +426,6 @@ static int Seek( access_t *p_access, uint64_t i_pos )
p_sys->i_current_seekpoint = i_seekpoint;
}
/* Reset eof */
p_access->info.b_eof = false;
return VLC_SUCCESS;
}
......
......@@ -395,7 +395,6 @@ static int Seek( access_t *p_access, uint64_t i_pos )
i_pos = __MIN( i_pos, p_sys->size );
p_sys->offset = i_pos;
p_access->info.b_eof = false;
/* find correct chapter */
FindSeekpoint( p_access );
......
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