- Fix crash due to badly managed crosslinking scene copy with original
- Fix use of depsgraph by isolating it in own bmain
Details
- Reviewers
Brecht Van Lommel (brecht) Sergey Sharybin (sergey) - Maniphest Tasks
- T70194: VSE: 'Prefetch frames' causes excessive CPU usage whenever there is animation on a strip (freezes when tweaking animation [Graph Editor, Dopesheet, typing in new values])
T69924: Video Editor: Prefetch stops when moving playhead and makes Blender hang on new file. - Commits
- rB2b29bf25fcaa: Fix T69924: Prefetch stops when moving playhead Fix T70194: Prefetch freezes…
Diff Detail
- Repository
- rB Blender
- Branch
- T69924 (branched from master)
- Build Status
Buildable 5103 Build 5103: arc lint + arc unit
Event Timeline
- Upon further reading, I realized, that pointer actually wasn't uninitialized, but I am still changing this line to avoid confusion.
I made one patch for both issues, because it would be quite hard to test T70194: VSE: 'Prefetch frames' causes excessive CPU usage whenever there is animation on a strip (freezes when tweaking animation [Graph Editor, Dopesheet, typing in new values]).
| source/blender/blenkernel/intern/seqprefetch.c | ||
|---|---|---|
| 342 | Do you know where exactly it needs to access the prefetch job from scene_eval? It would be cleaner if we could avoid the need for that entirely. | |
| source/blender/blenkernel/intern/seqprefetch.c | ||
|---|---|---|
| 342 | For example in BKE_sequencer_cache_put() When called form prefetch thread, context will refer to bmain_eval, scene_eval and even sequence will be copy of original. so we swap thos values by if (context->is_prefetch_render) {
context = BKE_sequencer_prefetch_get_original_context(context);
scene = context->scene;
seq = BKE_sequencer_prefetch_get_original_sequence(seq, scene);
}scene = context->scene; is equivalent to scene = scene_eval->ed->prefetch_job->context->scene cache calls are quite deep, numerous and spread across the code, so now this seems to be the cleanest solution to me | |
Testing the latest diff:
The prefetch stop when moving playhead is now fixed.
The main problem is when prefetching isn't fast enough(on my computer) to avoid the playhead catching up, which makes the video freeze, while the audio keeps playing for a while even after stopping it. (A faster decodeable codec like DNxHD(for proxies) might solve this, and of course making sure that there is not mismatch between footage resolution and render resolution, switching Show Cache Off, and set Blendmode as Cross)
When looping a range which is longer than the cache area, the prefetch cache should continue at the beginning(which it doesn't now)(gif):
Playing Reverse outside the cached area, will make Blender freeze/unresponsive.
Maybe it could be considered to keep a bit of cached frames before the playhead for the often used toggle Reverse/Forward Play operation for finding the right frame to cut?
The main problem is when prefetching isn't fast enough(on my computer) to avoid the playhead catching up, which makes the video freeze, while the audio keeps playing for a while even after stopping it.
Sure I thinh both issues are reported, I wont be mixing that here.
When looping a range which is longer than the cache area, the prefetch cache should continue at the beginning(which it doesn't now)(gif):
Playing Reverse outside the cached area, will make Blender freeze/unresponsive.
This I should look into here
Maybe it could be considered to keep a bit of cached frames before the playhead for the often used toggle Reverse/Forward Play operation for finding the right frame to cut?
Yeah I was thinking, this feature will be missing...
but let's keep discussion here on topic.
- Upon further reading, I realized, that pointer actually wasn't uninitialized, but I am still changing this line to avoid confusion.
- initialize depsgraph in isolated bmain struct
- Fix prefetching range (forgot in initial prefetch commit)
- Fix crash - Add check if prefetch job is initialized and running.
