diff options
author | wm4 <wm4@nowhere> | 2017-10-23 19:36:20 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-10-23 19:36:20 +0200 |
commit | 512509705e03ed0bda122e1e96cda8a40eeaf720 (patch) | |
tree | 5580b35ddffc8e3e17a96803069ad39e723756e1 /demux/demux.c | |
parent | dbd22f43be49059c0ec801389103d5d16229bf26 (diff) | |
download | mpv-512509705e03ed0bda122e1e96cda8a40eeaf720.tar.bz2 mpv-512509705e03ed0bda122e1e96cda8a40eeaf720.tar.xz |
demux: report buffered duration of 0 during seeking instead of unknown
Looks ugly on the status line and could upset the buffering logic.
Diffstat (limited to 'demux/demux.c')
-rw-r--r-- | demux/demux.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/demux/demux.c b/demux/demux.c index 35e7059426..6e13817b87 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -1946,8 +1946,8 @@ static int cached_demux_control(struct demux_internal *in, int cmd, void *arg) // DTS or PTS, while ts_min should be as accurate as possible, as // we would have to trigger a real seek if it's off and we seeked // there) - r->ts_max = MP_PTS_MAX(r->ts_max, ds->last_ts); r->ts_min = MP_PTS_MAX(r->ts_min, ds->back_pts); + r->ts_max = MP_PTS_MAX(r->ts_max, ds->last_ts); if (ds->queue_head) { double ts = PTS_OR_DEF(ds->queue_head->dts, ds->queue_head->pts); @@ -1957,13 +1957,15 @@ static int cached_demux_control(struct demux_internal *in, int cmd, void *arg) } r->idle = (in->idle && !r->underrun) || r->eof; r->underrun &= !r->idle; - if (in->seeking) - r->ts_max = r->ts_min = MP_NOPTS_VALUE; r->ts_start = MP_ADD_PTS(r->ts_start, in->ts_offset); r->ts_min = MP_ADD_PTS(r->ts_min, in->ts_offset); r->ts_max = MP_ADD_PTS(r->ts_max, in->ts_offset); if (r->ts_reader != MP_NOPTS_VALUE && r->ts_reader <= r->ts_max) r->ts_duration = r->ts_max - r->ts_reader; + if (in->seeking) { + r->ts_max = r->ts_min = MP_NOPTS_VALUE; + r->ts_duration = 0; + } return CONTROL_OK; } } |