summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-03 21:59:20 +0100
committerwm4 <wm4@nowhere>2014-11-03 21:59:20 +0100
commit5438a8b32e197e2e2522f6cd9dcbe3b8a99e9303 (patch)
tree55202ff1b06330947e977f7d9d4b6a1c817f618f
parent7c2c1dbe8005b2d2f9aac7f5f10b46715f27addd (diff)
downloadmpv-5438a8b32e197e2e2522f6cd9dcbe3b8a99e9303.tar.bz2
mpv-5438a8b32e197e2e2522f6cd9dcbe3b8a99e9303.tar.xz
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.
-rw-r--r--demux/demux.c6
1 files 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;