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.
This commit is contained in:
wm4
2017-01-26 18:27:30 +01:00
parent abc6d130ac
commit 4e53f9e5b2

View File

@@ -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)