summaryrefslogtreecommitdiffstats
path: root/stream/stream.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-26 18:23:43 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-05-26 18:23:43 +0000
commitc36de0867fc576ad5fd58fc28bd5fe3322579f36 (patch)
treef2eab7727e5fae4c4ba87d6cbe34ca4f0901e2e2 /stream/stream.c
parent1e0b9a97fd840c547bc22591ce225f998d0cf3c5 (diff)
downloadmpv-c36de0867fc576ad5fd58fc28bd5fe3322579f36.tar.bz2
mpv-c36de0867fc576ad5fd58fc28bd5fe3322579f36.tar.xz
Retry reading even if we hit eof before.
This allows playing growing files even with a large cache. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31226 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream/stream.c')
-rw-r--r--stream/stream.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/stream/stream.c b/stream/stream.c
index d4abc69343..cdd9713a20 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -263,7 +263,7 @@ stream_t* open_output_stream(const char* filename, char** options) {
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 @@ int stream_fill_buffer(stream_t *s){
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;