summaryrefslogtreecommitdiffstats
path: root/player/misc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-29 21:54:59 +0100
committerwm4 <wm4@nowhere>2014-10-29 21:54:59 +0100
commit2bb02879aa3ebdb5d4e51d8d410c929fe26d58be (patch)
treed044f19399188efd5059261475a45efc1ddf4ce7 /player/misc.c
parent2c320fb609dde644bcfa3389e6a2664baa38ee2b (diff)
downloadmpv-2bb02879aa3ebdb5d4e51d8d410c929fe26d58be.tar.bz2
mpv-2bb02879aa3ebdb5d4e51d8d410c929fe26d58be.tar.xz
player: don't display zero duration for files with unknown duration
On OSD/terminal, just don't display the duration if unavailable. Make the "length" property unavailable if duration is unavailable.
Diffstat (limited to 'player/misc.c')
-rw-r--r--player/misc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/player/misc.c b/player/misc.c
index 6ddbc31f52..4fbef24d8e 100644
--- a/player/misc.c
+++ b/player/misc.c
@@ -65,12 +65,12 @@ double rel_time_to_abs(struct MPContext *mpctx, struct m_rel_time t)
if (t.pos >= 0) {
return start + t.pos;
} else {
- if (length != 0)
+ if (length >= 0)
return MPMAX(start + length + t.pos, 0.0);
}
break;
case REL_TIME_PERCENT:
- if (length != 0)
+ if (length >= 0)
return start + length * (t.pos / 100.0);
break;
case REL_TIME_CHAPTER: