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.
This commit is contained in:
wm4 2018-03-07 22:51:29 +01:00 committed by Kevin Mitchell
parent 075aa21797
commit 5f41fbb6d9
1 changed files with 1 additions and 1 deletions

View File

@ -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;