mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user