mirror of https://github.com/mpv-player/mpv
Yet more cosmetics
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24484 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
a6a96ab944
commit
c09ba25466
|
@ -251,7 +251,7 @@ static int tmf_load_chunk( demuxer_t *demux, TiVoInfo *tivo,
|
||||||
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" );
|
||||||
return( 0 );
|
return 0;
|
||||||
}
|
}
|
||||||
count = stream_read( demux->stream, buff, size );
|
count = stream_read( demux->stream, buff, size );
|
||||||
demux->filepos = stream_tell( demux->stream );
|
demux->filepos = stream_tell( demux->stream );
|
||||||
|
@ -345,8 +345,7 @@ static int IsValidAudioPacket( int size, int *ptsOffset, int *ptsLen )
|
||||||
size );
|
size );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
return 1;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -511,9 +510,7 @@ static int demux_ty_fill_buffer( demuxer_t *demux, demux_stream_t *dsds )
|
||||||
tivo->firstVideoPTS = MP_NOPTS_VALUE;
|
tivo->firstVideoPTS = MP_NOPTS_VALUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
tivo = demux->a_streams[ MAX_A_STREAMS - 1 ];
|
tivo = demux->a_streams[ MAX_A_STREAMS - 1 ];
|
||||||
}
|
|
||||||
|
|
||||||
if( demux->stream->eof ) return 0;
|
if( demux->stream->eof ) return 0;
|
||||||
|
|
||||||
|
@ -635,13 +632,10 @@ static int demux_ty_fill_buffer( demuxer_t *demux, demux_stream_t *dsds )
|
||||||
mp_msg( MSGT_DEMUX, MSGL_DBG3,
|
mp_msg( MSGT_DEMUX, MSGL_DBG3,
|
||||||
"\nty:wanted current offset %"PRIx64"\n", (int64_t)stream_tell( demux->stream ) );
|
"\nty:wanted current offset %"PRIx64"\n", (int64_t)stream_tell( demux->stream ) );
|
||||||
|
|
||||||
if ( tivo->size > 0 )
|
if ( tivo->size > 0 && stream_tell( demux->stream ) > tivo->size )
|
||||||
{
|
{
|
||||||
if ( stream_tell( demux->stream ) > tivo->size )
|
|
||||||
{
|
|
||||||
demux->stream->eof = 1;
|
demux->stream->eof = 1;
|
||||||
return( 0 );
|
return 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( tivo->tmf != 1 )
|
if ( tivo->tmf != 1 )
|
||||||
|
@ -651,9 +645,7 @@ static int demux_ty_fill_buffer( demuxer_t *demux, demux_stream_t *dsds )
|
||||||
{
|
{
|
||||||
whichChunk = demux->filepos / CHUNKSIZE;
|
whichChunk = demux->filepos / CHUNKSIZE;
|
||||||
if ( demux->filepos % CHUNKSIZE > CHUNKSIZE / 2 )
|
if ( demux->filepos % CHUNKSIZE > CHUNKSIZE / 2 )
|
||||||
{
|
|
||||||
whichChunk++;
|
whichChunk++;
|
||||||
}
|
|
||||||
stream_seek( demux->stream, whichChunk * CHUNKSIZE );
|
stream_seek( demux->stream, whichChunk * CHUNKSIZE );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -661,9 +653,7 @@ static int demux_ty_fill_buffer( demuxer_t *demux, demux_stream_t *dsds )
|
||||||
tivo->whichChunk = demux->filepos / CHUNKSIZE;
|
tivo->whichChunk = demux->filepos / CHUNKSIZE;
|
||||||
readSize = stream_read( demux->stream, chunk, CHUNKSIZE );
|
readSize = stream_read( demux->stream, chunk, CHUNKSIZE );
|
||||||
if ( readSize != CHUNKSIZE )
|
if ( readSize != CHUNKSIZE )
|
||||||
{
|
return 0;
|
||||||
return( 0 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -692,9 +682,7 @@ static int demux_ty_fill_buffer( demuxer_t *demux, demux_stream_t *dsds )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( readSize != CHUNKSIZE )
|
if ( readSize != CHUNKSIZE )
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mp_msg( MSGT_DEMUX, MSGL_DBG3,
|
mp_msg( MSGT_DEMUX, MSGL_DBG3,
|
||||||
"\nty:actual current offset %"PRIx64"\n", stream_tell( demux->stream ) -
|
"\nty:actual current offset %"PRIx64"\n", stream_tell( demux->stream ) -
|
||||||
|
@ -1059,15 +1047,11 @@ static int demux_ty_fill_buffer( demuxer_t *demux, demux_stream_t *dsds )
|
||||||
|
|
||||||
// Invalid MPEG ES Size Check
|
// Invalid MPEG ES Size Check
|
||||||
if ( errorHeader > numberRecs / 2 )
|
if ( errorHeader > numberRecs / 2 )
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
// Invalid MPEG Stream Type Check
|
// Invalid MPEG Stream Type Check
|
||||||
if ( invalidType > numberRecs / 2 )
|
if ( invalidType > numberRecs / 2 )
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
demux->filepos = stream_tell( demux->stream );
|
demux->filepos = stream_tell( demux->stream );
|
||||||
|
@ -1101,10 +1085,8 @@ static void demux_seek_ty( demuxer_t *demuxer, float rel_seek_secs, float audio_
|
||||||
newpos = ( flags & 1 ) ? demuxer->movi_start : demuxer->filepos;
|
newpos = ( flags & 1 ) ? demuxer->movi_start : demuxer->filepos;
|
||||||
|
|
||||||
if( flags & 2 )
|
if( flags & 2 )
|
||||||
{
|
|
||||||
// float seek 0..1
|
// float seek 0..1
|
||||||
newpos += ( demuxer->movi_end - demuxer->movi_start ) * rel_seek_secs;
|
newpos += ( demuxer->movi_end - demuxer->movi_start ) * rel_seek_secs;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// time seek (secs)
|
// time seek (secs)
|
||||||
|
|
Loading…
Reference in New Issue