mirror of https://github.com/mpv-player/mpv
Simplify EOF handling
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24472 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
9ec6875d20
commit
bd5e05cde4
|
@ -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",
|
mp_msg( MSGT_DEMUX, MSGL_DBG3, "\ntmf_load_chunk() begin %d\n",
|
||||||
readChunk );
|
readChunk );
|
||||||
|
|
||||||
if ( tivo->tmf_totalparts <= 0 )
|
|
||||||
{
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( readChunk >= tivo->tmf_totalchunks )
|
|
||||||
{
|
|
||||||
mp_msg( MSGT_DEMUX, MSGL_ERR, "Read past EOF()\n" );
|
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
fileoffset = tmf_filetooffset(tivo, readChunk);
|
fileoffset = tmf_filetooffset(tivo, readChunk);
|
||||||
|
|
||||||
|
if (fileoffset == -1) {
|
||||||
|
mp_msg(MSGT_DEMUX, MSGL_ERR, "Read past EOF()\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ( stream_seek( demux->stream, fileoffset ) != 1 )
|
if ( stream_seek( demux->stream, fileoffset ) != 1 )
|
||||||
{
|
{
|
||||||
mp_msg( MSGT_DEMUX, MSGL_ERR, "Read past EOF()\n" );
|
mp_msg( MSGT_DEMUX, MSGL_ERR, "Read past EOF()\n" );
|
||||||
|
|
Loading…
Reference in New Issue