From 5438a8b32e197e2e2522f6cd9dcbe3b8a99e9303 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 3 Nov 2014 21:59:20 +0100 Subject: demux: don't account known range for streams that are EOF This influences the demuxer readahead display. If a stream has reached EOF, we want to ignore it for the purpose of this calculation. Note that if a stream contains no packets, it still should cause the value 0s to be displayed (unless it's EOF), because that's just the actual situation. --- demux/demux.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/demux/demux.c b/demux/demux.c index 73bc6247c2..b170b731c0 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -1222,8 +1222,10 @@ static int cached_demux_control(struct demux_internal *in, int cmd, void *arg) struct demux_stream *ds = in->d_user->streams[n]->ds; if (ds->active) { r->underrun |= !ds->head && !ds->eof; - r->ts_range[0] = MP_PTS_MAX(r->ts_range[0], ds->base_ts); - r->ts_range[1] = MP_PTS_MIN(r->ts_range[1], ds->last_ts); + if (!ds->eof) { + r->ts_range[0] = MP_PTS_MAX(r->ts_range[0], ds->base_ts); + r->ts_range[1] = MP_PTS_MIN(r->ts_range[1], ds->last_ts); + } } } r->idle = (in->idle && !r->underrun) || r->eof; -- cgit v1.2.3