From 5f41fbb6d931700d4bc7455ca7bf289d15d6d8eb Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 7 Mar 2018 22:51:29 +0100 Subject: 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. --- demux/demux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demux') 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; -- cgit v1.2.3