command: report unknown file size as unavailable, not -1

This commit is contained in:
wm4 2018-09-15 19:09:53 +02:00
parent adbd035b50
commit 475f61710e
1 changed files with 2 additions and 0 deletions

View File

@ -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);