mirror of https://github.com/mpv-player/mpv
command: cache can actually have full-size 0
Then it's simply empty.
This commit is contained in:
parent
b1969c0eba
commit
94450bf410
|
@ -1147,7 +1147,7 @@ static int mp_property_cache_used(void *ctx, struct m_property *prop,
|
||||||
case M_PROPERTY_GET: {
|
case M_PROPERTY_GET: {
|
||||||
int64_t size = -1;
|
int64_t size = -1;
|
||||||
stream_control(mpctx->stream, STREAM_CTRL_GET_CACHE_FILL, &size);
|
stream_control(mpctx->stream, STREAM_CTRL_GET_CACHE_FILL, &size);
|
||||||
if (size <= 0)
|
if (size < 0)
|
||||||
break;
|
break;
|
||||||
*(int *)arg = size / 1024;
|
*(int *)arg = size / 1024;
|
||||||
return M_PROPERTY_OK;
|
return M_PROPERTY_OK;
|
||||||
|
@ -1162,7 +1162,7 @@ static int mp_property_cache_used(void *ctx, struct m_property *prop,
|
||||||
case M_PROPERTY_PRINT: {
|
case M_PROPERTY_PRINT: {
|
||||||
int64_t size = -1;
|
int64_t size = -1;
|
||||||
stream_control(mpctx->stream, STREAM_CTRL_GET_CACHE_FILL, &size);
|
stream_control(mpctx->stream, STREAM_CTRL_GET_CACHE_FILL, &size);
|
||||||
if (size <= 0)
|
if (size < 0)
|
||||||
break;
|
break;
|
||||||
*(char **)arg = format_file_size(size);
|
*(char **)arg = format_file_size(size);
|
||||||
return M_PROPERTY_OK;
|
return M_PROPERTY_OK;
|
||||||
|
@ -1182,7 +1182,7 @@ static int mp_property_cache_free(void *ctx, struct m_property *prop,
|
||||||
case M_PROPERTY_GET: {
|
case M_PROPERTY_GET: {
|
||||||
int64_t size_used = -1;
|
int64_t size_used = -1;
|
||||||
stream_control(mpctx->stream, STREAM_CTRL_GET_CACHE_FILL, &size_used);
|
stream_control(mpctx->stream, STREAM_CTRL_GET_CACHE_FILL, &size_used);
|
||||||
if (size_used <= 0)
|
if (size_used < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
int64_t size = -1;
|
int64_t size = -1;
|
||||||
|
@ -1203,7 +1203,7 @@ static int mp_property_cache_free(void *ctx, struct m_property *prop,
|
||||||
case M_PROPERTY_PRINT: {
|
case M_PROPERTY_PRINT: {
|
||||||
int64_t size_used = -1;
|
int64_t size_used = -1;
|
||||||
stream_control(mpctx->stream, STREAM_CTRL_GET_CACHE_FILL, &size_used);
|
stream_control(mpctx->stream, STREAM_CTRL_GET_CACHE_FILL, &size_used);
|
||||||
if (size_used <= 0)
|
if (size_used < 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
int64_t size = -1;
|
int64_t size = -1;
|
||||||
|
|
Loading…
Reference in New Issue