1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-22 11:18:32 +00:00

nicer EOF solution, mpeg-ps works now too

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12167 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2004-04-11 15:04:54 +00:00
parent 1c80573d19
commit d854c5c06a

View File

@ -57,8 +57,7 @@ static int mp_read(URLContext *h, unsigned char *buf, int size){
if(stream_eof(stream)) //needed?
return -1;
ret=stream_read(stream, buf, size);
if(ret>0)
stream->eof=0;
mp_msg(MSGT_HEADER,MSGL_DBG2,"%d=mp_read(%p, %p, %d), eof:%d\n", ret, h, buf, size, stream->eof);
return ret;
}
@ -78,10 +77,11 @@ static offset_t mp_seek(URLContext *h, offset_t pos, int whence){
else if(whence != SEEK_SET)
return -1;
if(pos<stream->end_pos)
stream_reset(stream);
if(stream_seek(stream, pos)==0)
return -1;
if(pos==stream->end_pos)
stream->eof=0;
return pos;
}