M4.8: Edit ▸ Purge clears what it names: disk and snapshot purges keep the RAM preview, memory purges drop decoded footage

- Every purge emptied the viewers' RAM preview; Purge ▸ All Disk Cache and Snapshot now leave
  it (Image Cache Memory, All Memory, All Memory & Disk Cache, All and All 3D Cache still
  clear it).
- The memory purges also drop the decoded footage frames (`FootageSource::purge`, the media
  pool's `clear_frames`; decoders stay open), so footage reads decode again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bflatastic
2026-10-05 01:03:47 +07:00
co-authored by Claude Opus 5.5
parent 5ce641c6b3
commit fa27d621e0
4 changed files with 45 additions and 4 deletions
+10 -3
View File
@@ -233,12 +233,16 @@ impl MediaPool {
}
}
/// Drop every cached frame and decoder.
pub fn clear(&self) {
/// Drop every cached frame (decoders stay open).
pub fn clear_frames(&self) {
let mut c = lock(&self.inner.cache);
c.lru = Lru::default();
c.last.clear();
drop(c);
}
/// Drop every cached frame and decoder.
pub fn clear(&self) {
self.clear_frames();
lock(&self.inner.sources).clear();
}
@@ -602,6 +606,9 @@ impl FootageSource for MediaPool {
fn set_cache_budget(&self, bytes: usize) {
self.set_budget(bytes);
}
fn purge(&self) {
self.clear_frames();
}
fn cache_budget(&self) -> Option<usize> {
Some(self.budget())
}