1
mirror of https://github.com/mpv-player/mpv synced 2025-01-09 01:36:25 +01:00

More simplifications

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24477 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-09-14 17:03:26 +00:00
parent 56f5ab430f
commit 5789ab4ab7

View File

@ -137,14 +137,12 @@ static int ty_tmf_filetoparts( demuxer_t *demux, TiVoInfo *tivo )
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 @@ static int ty_tmf_filetoparts( demuxer_t *demux, TiVoInfo *tivo )
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 @@ static int ty_tmf_filetoparts( demuxer_t *demux, TiVoInfo *tivo )
skip = 512 + ((size + 511) & ~511);
if ( offset + skip > totalsize )
{
size = totalsize - offset;
}
isty = ty_extensionis( name, ".ty" );
@ -218,9 +210,8 @@ static int ty_tmf_filetoparts( demuxer_t *demux, TiVoInfo *tivo )
parts++;
}
if ( ( offset + skip ) > totalsize )
if (offset + skip >= totalsize)
break;
else
offset += skip;
}
tivo->tmf_totalparts = parts;