vo_gpu_next: invalidate cache object if requested by libplacebo

See: https://code.videolan.org/videolan/libplacebo/-/merge_requests/659
This commit is contained in:
Kacper Michajłow 2024-04-17 01:26:13 +02:00
parent dc632e16d2
commit 2f8038c598
1 changed files with 5 additions and 3 deletions

View File

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