diff options
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo_gpu_next.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 0a93f6329c..d68c836b52 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1636,9 +1636,6 @@ done: static void cache_save_obj(void *p, pl_cache_obj obj) { - if (!obj.data || !obj.size) - return; - const struct cache *c = p; void *ta_ctx = talloc_new(NULL); @@ -1649,6 +1646,11 @@ static void cache_save_obj(void *p, pl_cache_obj obj) if (!filepath) goto done; + if (!obj.data || !obj.size) { + unlink(filepath); + goto done; + } + // Don't save if already exists if (!stat(filepath, &(struct stat){0})) { MP_DBG(c, "%s: key(%"PRIx64"), size(%zu)\n", __func__, obj.key, obj.size); |