aboutsummaryrefslogtreecommitdiffhomepage
path: root/demux
diff options
context:
space:
mode:
Diffstat (limited to 'demux')
-rw-r--r--demux/demux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/demux/demux.c b/demux/demux.c
index 4d70938938..4563a034a2 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -1183,7 +1183,7 @@ static void adjust_seek_range_on_packet(struct demux_stream *ds,
void demux_add_packet(struct sh_stream *stream, demux_packet_t *dp)
{
struct demux_stream *ds = stream ? stream->ds : NULL;
- if (!dp || !dp->len || !ds) {
+ if (!dp || !dp->len || !ds || demux_cancel_test(ds->in->d_thread)) {
talloc_free(dp);
return;
}
@@ -1306,7 +1306,7 @@ static bool read_packet(struct demux_internal *in)
in->eof = false;
in->idle = true;
- if (!in->reading || in->blocked)
+ if (!in->reading || in->blocked || demux_cancel_test(in->d_thread))
return false;
// Check if we need to read a new packet. We do this if all queues are below