summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-09-15 19:09:53 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commit475f61710e4894788309613c58eafee88d53594a (patch)
tree35eb370e9fb3d88087fcb6f698bce04f6f660c54
parentadbd035b50aabdef1f401f51a8f1d06d6f3d79d3 (diff)
downloadmpv-475f61710e4894788309613c58eafee88d53594a.tar.bz2
mpv-475f61710e4894788309613c58eafee88d53594a.tar.xz
command: report unknown file size as unavailable, not -1
-rw-r--r--player/command.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/player/command.c b/player/command.c
index 71238e4ae1..167ebe539b 100644
--- a/player/command.c
+++ b/player/command.c
@@ -558,6 +558,8 @@ static int mp_property_file_size(void *ctx, struct m_property *prop,
return M_PROPERTY_UNAVAILABLE;
int64_t size = mpctx->demuxer->filesize;
+ if (size < 0)
+ return M_PROPERTY_UNAVAILABLE;
if (action == M_PROPERTY_PRINT) {
*(char **)arg = format_file_size(size);