summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_ty.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux/demux_ty.c')
-rw-r--r--libmpdemux/demux_ty.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/libmpdemux/demux_ty.c b/libmpdemux/demux_ty.c
index 828345147e..aba5919843 100644
--- a/libmpdemux/demux_ty.c
+++ b/libmpdemux/demux_ty.c
@@ -282,19 +282,13 @@ static int tmf_load_chunk( demuxer_t *demux, TiVoInfo *tivo,
mp_msg( MSGT_DEMUX, MSGL_DBG3, "\ntmf_load_chunk() begin %d\n",
readChunk );
- if ( tivo->tmf_totalparts <= 0 )
- {
- return( 0 );
- }
+ fileoffset = tmf_filetooffset(tivo, readChunk);
- if ( readChunk >= tivo->tmf_totalchunks )
- {
- mp_msg( MSGT_DEMUX, MSGL_ERR, "Read past EOF()\n" );
- return( 0 );
+ if (fileoffset == -1) {
+ mp_msg(MSGT_DEMUX, MSGL_ERR, "Read past EOF()\n");
+ return 0;
}
- fileoffset = tmf_filetooffset(tivo, readChunk);
-
if ( stream_seek( demux->stream, fileoffset ) != 1 )
{
mp_msg( MSGT_DEMUX, MSGL_ERR, "Read past EOF()\n" );