Mercurial > mplayer.hg
diff stream/stream.c @ 31169:ac84149bbdaf
Retry reading even if we hit eof before.
This allows playing growing files even with a large cache.
author | reimar |
---|---|
date | Wed, 26 May 2010 18:23:43 +0000 |
parents | 39d953a7ee22 |
children | b2bb87b92146 |
line wrap: on
line diff
--- a/stream/stream.c Wed May 26 18:01:38 2010 +0000 +++ b/stream/stream.c Wed May 26 18:23:43 2010 +0000 @@ -263,7 +263,7 @@ int stream_fill_buffer(stream_t *s){ int len; - if (/*s->fd == NULL ||*/ s->eof) { return 0; } + // we will retry even if we already reached EOF previously. switch(s->type){ case STREAMTYPE_STREAM: #ifdef CONFIG_NETWORK @@ -285,6 +285,9 @@ len= s->fill_buffer ? s->fill_buffer(s,s->buffer,STREAM_BUFFER_SIZE) : 0; } if(len<=0){ s->eof=1; return 0; } + // When reading succeeded we are obviously not at eof. + // This e.g. avoids issues with eof getting stuck when lavf seeks in MPEG-TS + s->eof=0; s->buf_pos=0; s->buf_len=len; s->pos+=len;