From bd5e05cde49611f21217a594f4138e65c76ae6ed Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 14 Sep 2007 16:44:52 +0000 Subject: Simplify EOF handling git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24472 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_ty.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'libmpdemux/demux_ty.c') 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" ); -- cgit v1.2.3