summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-02-04 22:50:45 +0100
committerwm4 <wm4@nowhere>2017-02-04 22:53:04 +0100
commit58c9f1a822bf226472eaa471c487988f9dac5c7f (patch)
tree366b390c6e1a49572a6c0ecac2a4be3a85587e88 /demux
parent7e6b37be07a433cca19309fc5ccfc762149301b6 (diff)
downloadmpv-58c9f1a822bf226472eaa471c487988f9dac5c7f.tar.bz2
mpv-58c9f1a822bf226472eaa471c487988f9dac5c7f.tar.xz
demux: try not to read packets when cancelled
Essentially, this will make it abort sooner. Especially with DASH it might avoid confusing error messages, although exact behavior depends on timing.
Diffstat (limited to 'demux')
-rw-r--r--demux/demux.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/demux/demux.c b/demux/demux.c
index d21b20910a..0c45083e2d 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -661,7 +661,9 @@ static bool read_packet(struct demux_internal *in)
demux->desc->seek(demux, seek_pts, SEEK_BACKWARD | SEEK_HR);
}
- bool eof = !demux->desc->fill_buffer || demux->desc->fill_buffer(demux) <= 0;
+ bool eof = true;
+ if (demux->desc->fill_buffer && !demux_cancel_test(demux))
+ eof = demux->desc->fill_buffer(demux) <= 0;
update_cache(in);
pthread_mutex_lock(&in->lock);