path: root/demux
diff options
authorwm4 <wm4@nowhere>2018-03-07 22:51:29 +0100
committerKevin Mitchell <>2018-03-08 17:12:32 -0800
commit5f41fbb6d931700d4bc7455ca7bf289d15d6d8eb (patch)
tree466580cbaffa865a9a8ce126d1be01b8e6708319 /demux
parent075aa21797e459b82bc95eb2c9336adfb8d562d0 (diff)
demux: correctly report buffered size as 0 if there are no packets
Since the demuxer cache addition, ds->queue->head can actually be set to non-NULL, but the decoder can still be at EOF (with no packets to come). This made it report an unknown buffered size, instead of 0. Fix this by checking the decoder part of the packet queue instead. Probably doesn't matter much, but fixes an annoying "???" on the CLI status line in some situations.
Diffstat (limited to 'demux')
1 files changed, 1 insertions, 1 deletions
diff --git a/demux/demux.c b/demux/demux.c
index abc79d539c..6958900406 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -2902,7 +2902,7 @@ static int cached_demux_control(struct demux_internal *in, int cmd, void *arg)
r->underrun |= !ds->reader_head && !ds->eof;
r->ts_reader = MP_PTS_MAX(r->ts_reader, ds->base_ts);
r->ts_end = MP_PTS_MAX(r->ts_end, ds->queue->last_ts);
- any_packets |= !!ds->queue->head;
+ any_packets |= !!ds->reader_head;
r->idle = (in->idle && !r->underrun) || r->eof;