changeset 24457:fd8830d276ca

More simplifications
author reimar
date Fri, 14 Sep 2007 17:03:26 +0000
parents 41c163b6bea4
children 6e8ee976e6d1
files libmpdemux/demux_ty.c
diffstat 1 files changed, 4 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ty.c	Fri Sep 14 17:00:09 2007 +0000
+++ b/libmpdemux/demux_ty.c	Fri Sep 14 17:03:26 2007 +0000
@@ -137,14 +137,12 @@
    char    *name;
    char    *sizestr;
    int     size;
-   int     count;
    off_t   offset;
    off_t   totalsize;
    off_t   skip;
    int     parts = 0;
    int     isty;
    int     index;
-   int     ok;
 
    offset = 0;
    totalsize = demux->stream->end_pos;
@@ -152,16 +150,12 @@
    mp_msg( MSGT_DEMUX, MSGL_DBG3, "Dumping tar contents\n" );
    while (1)
    {
-      ok = stream_seek( demux->stream, offset );
-      if ( offset + 512 == totalsize )
-         break;
-      if ( ok == 0 )
+      if (!stream_seek(demux->stream, offset))
       { 
          mp_msg( MSGT_DEMUX, MSGL_DBG3, "Seek bad %"PRId64"\n", (int64_t)offset );
          break;
       }
-      count = stream_read( demux->stream, header, 512 );
-      if ( count < 512 )
+      if (stream_read(demux->stream, header, 512) < 512)
       { 
          mp_msg( MSGT_DEMUX, MSGL_DBG3, "Read bad\n" );
          break;
@@ -176,9 +170,7 @@
       skip = 512 + ((size + 511) & ~511);
 
       if ( offset + skip > totalsize )
-      {
          size = totalsize - offset;
-      }
 
       isty = ty_extensionis( name, ".ty" );
 
@@ -218,10 +210,9 @@
          parts++;
       }
 
-      if ( ( offset + skip ) > totalsize )
+      if (offset + skip >= totalsize)
          break;
-      else
-         offset += skip;
+      offset += skip;
    }
    tivo->tmf_totalparts = parts;
    mp_msg( MSGT_DEMUX, MSGL_DBG3,