diff options
author | wm4 <wm4@nowhere> | 2017-01-26 18:27:30 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-01-26 18:27:30 +0100 |
commit | 4e53f9e5b20efb121bdd19464f1e1af14c981227 (patch) | |
tree | f6e4133b04f503bb4cb114ecee43e33509189a43 /stream/stream.c | |
parent | abc6d130ace804bfa333955ff2cd402d927959c6 (diff) | |
download | mpv-4e53f9e5b20efb121bdd19464f1e1af14c981227.tar.bz2 mpv-4e53f9e5b20efb121bdd19464f1e1af14c981227.tar.xz |
stream: set EOF if stream is canceled
Commit 7be495b3 added the cancellation test, but forgot to set the eof
flag. This could lead to demux_mkv.c not terminating if the stream was
cancelled in some code paths.
This function is what is supposed to set the EOF flag in the first
place, so just add the missing code.
Diffstat (limited to 'stream/stream.c')
-rw-r--r-- | stream/stream.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/stream/stream.c b/stream/stream.c index b4e4bd9c70..6fc8e95b08 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -361,8 +361,10 @@ static int stream_read_unbuffered(stream_t *s, void *buf, int len) { int orig_len = len; s->buf_pos = s->buf_len = 0; - if (mp_cancel_test(s->cancel)) + if (mp_cancel_test(s->cancel)) { + s->eof = 1; return 0; + } // we will retry even if we already reached EOF previously. len = s->fill_buffer ? s->fill_buffer(s, buf, len) : -1; if (len < 0) |