Bug 364012 - git master: optimization for loading existing preview render chunks may conflict with change clip invalidation
Summary: git master: optimization for loading existing preview render chunks may confl...
Status: RESOLVED FIXED
Alias: None
Product: kdenlive
Classification: Applications
Component: User Interface & Miscellaneous (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-06 08:27 UTC by Wegwerf
Modified: 2016-08-12 16:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wegwerf 2016-06-06 08:27:28 UTC
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.
Comment 1 Wegwerf 2016-06-06 08:32:38 UTC
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?
Comment 2 Jean-Baptiste Mardelle 2016-06-06 08:39:40 UTC
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.
Comment 3 Wegwerf 2016-06-07 15:06:10 UTC
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.
Comment 4 Wegwerf 2016-08-12 16:25:10 UTC
Fixed.