changeset 24452:f71e3d4c2816

Simplify EOF handling
author reimar
date Fri, 14 Sep 2007 16:44:52 +0000
parents abcfa91fcc9a
children 78d5334a4b85
files libmpdemux/demux_ty.c
diffstat 1 files changed, 4 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ty.c	Fri Sep 14 16:42:46 2007 +0000
+++ b/libmpdemux/demux_ty.c	Fri Sep 14 16:44:52 2007 +0000
@@ -282,19 +282,13 @@
    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" );