With the most recent git master I now see that after reloading a clip (such as a slideshow clip) the corresponding timeline parts get properly invalidated. However, upon clicking the preview render button (automatic rendering is off) the stale and now invalid chunks get quickly picked up and the affected zone turns green without properly rerendering it. At the moment, I need to unset this zone first, then set it again, in order to correctly rerender it. Reproducible: Always Steps to Reproduce: 0. Make sure that automatic preview rendering is turned off. 1. Create new project. 2. Add slideshow clip to project (title clip may also work). 3. Place the slideshow clip on the timeline. 4. Render preview for zone of slideshow clip. Wait for rendering to complete. 5. Reload slideslow clip. Affected timeline zone should turn red. 6. Click on preview render button. Actual Results: Affected timeline zone quickly turns green without rerendering the affected zone. Expected Results: Affected timeline zone should be rerendered instead of reusing the old and stale preview chunks.
By the way: on the other hand, reloading a project after a full preview render starts with the old preview rendering zone being red. Kdenlive does not pick up the existing preview chunks. Could that be because I saved the project after preview rendering again?
I will check this problem tonight. Regarding your second comment, currently we proceed like this on project opening: We check the project file's last save date/time and compare it with preview chunks date/time. If a chunk is more recent than the project date, we delete it (in case user played with the project but decided not to save the changes). So if you don't save your project after preview rendering is finished, these new chunks will be deleted. However in my quick tests, I frequently forgot to save just because of the timeline preview, so maybe we can find a more clever approach than comparing dates, something like a hash of the project file so that chunks newer than project file are not deleted if the project has not changed... will look into it.
Probably some project token, sich as a hash, but can be even simpler, would suffice. It gets updated with each project edit after a save. The cache, in turn, remembers the most recent project token it had been used with. 1. user edits project, prerenders project, then saves project, then reloads: will pick up the cache contents as reloaded project token equals cached project token. 2. user edits project, saves project, prerenders project, the reloads: same as 1, project token equals cached project token. 3. user edits projects, prerenders project, then aborts and reloads project: cached project token doesn't match saved project token anymore, cache needs to be invalidated completely.
Fixed.