diff options
author | Kacper Michajłow <kasper93@gmail.com> | 2024-05-10 21:15:34 +0200 |
---|---|---|
committer | Kacper Michajłow <kasper93@gmail.com> | 2024-05-10 22:54:25 +0200 |
commit | f17ad792c675d2e953cdecf81b8fb0c03ef71690 (patch) | |
tree | 1a3a48a5b8afd9be0dae6c523ff1740b9635baa8 | |
parent | 1f69659a77c84ee0ef08860b7ad8ab7b7e06bf3e (diff) | |
download | mpv-f17ad792c675d2e953cdecf81b8fb0c03ef71690.tar.bz2 mpv-f17ad792c675d2e953cdecf81b8fb0c03ef71690.tar.xz |
vo_gpu_next: check if existing cache file has correct size
-rw-r--r-- | video/out/vo_gpu_next.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 73111a5d1c..67f7d5833a 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1650,7 +1650,8 @@ static void cache_save_obj(void *p, pl_cache_obj obj) } // Don't save if already exists - if (!stat(filepath, &(struct stat){0})) { + struct stat st; + if (!stat(filepath, &st) && st.st_size == obj.size) { MP_DBG(c, "%s: key(%"PRIx64"), size(%zu)\n", __func__, obj.key, obj.size); goto done; } |