Cleanup/Fix VSE readfile code, fully deprecate SEQ_TYPE_SOUND_HD. #111135

Merged
Bastien Montagne merged 1 commits from mont29/blender:tmp-vse-readfile-cleanup into main 2023-08-17 16:09:22 +02:00

This fixes a few related issues in VSE code:

  • 'lib_link' code was doing 'read_data' tasks (like cleaning up internal
    runtime data).
  • Handling of SEQ_TYPE_SOUND_HD deprecated type of strips was
    extremely confusing (versioning done partly in 'lib_link' code, partly
    in some 2.50 do_version code).
  • Still using deprecated SEQ_TYPE_SOUND_HD strip type outside of
    versioning code.
  • Missing proper usage of deprecated SEQ_TYPE_SOUND_HD type inside of
    versioning code (!).

Note that the actual conversion from SEQ_TYPE_SOUND_HD to
SEQ_TYPE_SOUND_RAM is now done in the 'after setup' versioning
process, where it is somewhat safer to add IDs. This implies that
SEQ_TYPE_SOUND_HD must be taken into account throughout the whole
regular versioning process (before and after liblink).

Conversion logic itself has been moved to the VSE code.

This fixes a few related issues in VSE code: * 'lib_link' code was doing 'read_data' tasks (like cleaning up internal runtime data). * Handling of `SEQ_TYPE_SOUND_HD` deprecated type of strips was extremely confusing (versioning done partly in 'lib_link' code, partly in some 2.50 do_version code). * Still using deprecated `SEQ_TYPE_SOUND_HD` strip type outside of versioning code. * Missing proper usage of deprecated `SEQ_TYPE_SOUND_HD` type inside of versioning code (!). Note that the actual conversion from `SEQ_TYPE_SOUND_HD` to `SEQ_TYPE_SOUND_RAM` is now done in the 'after setup' versioning process, where it is somewhat safer to add IDs. This implies that `SEQ_TYPE_SOUND_HD` must be taken into account throughout the whole regular versioning process (before and after liblink). Conversion logic itself has been moved to the VSE code.
Bastien Montagne added this to the 4.0 milestone 2023-08-15 15:06:19 +02:00
Bastien Montagne added the
Interest
BlendFile
Module
Core
Interest
Video Sequencer
labels 2023-08-15 15:06:20 +02:00
Bastien Montagne reviewed 2023-08-15 15:09:24 +02:00
@ -881,4 +884,2 @@
}
if (seq->sound) {
seq->scene_sound = nullptr;
if (seq->type == SEQ_TYPE_SOUND_HD) {
Author
Owner

This is the piece of code that is making me doubt. By the look of it, if seq->type == SEQ_TYPE_SOUND_HD, seq type is updated, but sound ID pointer itself is happily kept as a fully invalid non-null pointer!

It looks so obviously wrong, that it makes me wondering if there is not some completely undocumented, non-standard handling of this SEQ_TYPE_SOUND_HD case somewhere else. But could not find anything.

This is the piece of code that is making me doubt. By the look of it, if `seq->type == SEQ_TYPE_SOUND_HD`, seq type is updated, but `sound` ID pointer itself is happily kept as a fully invalid non-null pointer! It looks so obviously wrong, that it makes me wondering if there is not some completely undocumented, non-standard handling of this `SEQ_TYPE_SOUND_HD` case somewhere else. But could not find anything.

I have looked at occurences, and there is no versioning apart from this piece of code, that as you said, shouldn't work. Will have to create old file to see how this behaves in practice.

I have looked at occurences, and there is no versioning apart from this piece of code, that as you said, shouldn't work. Will have to create old file to see how this behaves in practice.

There is some suspecious code in the seq_sound_proxy_update_cb, which allocates sound datablock. Perhaps that is what makes the sound to be a non-stale pointer?

There is some suspecious code in the `seq_sound_proxy_update_cb`, which allocates sound datablock. Perhaps that is what makes the sound to be a non-stale pointer?
Bastien Montagne requested review from Sergey Sharybin 2023-08-15 15:10:16 +02:00
Bastien Montagne requested review from Richard Antalik 2023-08-15 15:21:14 +02:00

I have created test file in 2.49, and it loads correctly in 4.0.
Haven't checked why it works yet, can do tomorrow only.

I have created test file in 2.49, and it loads correctly in 4.0. Haven't checked why it works yet, can do tomorrow only.
125 KiB

I have created test file in 2.49, and it loads correctly in 4.0.

Form my understanding the code under question came from the sound project for 2.5: 6c5c58e057.

> I have created test file in 2.49, and it loads correctly in 4.0. Form my understanding the code under question came from the sound project for 2.5: 6c5c58e0579.
Author
Owner

It is indeed coming from 6c5c58e057, and matching with evil done in seq_sound_proxy_update_cb.

This needs to be handled separately, from setup_app_data...

It is indeed coming from 6c5c58e057, and matching with evil done in `seq_sound_proxy_update_cb`. This needs to be handled separately, from `setup_app_data`...
Author
Owner

Also related note, current main code will assert on BLI_assert(bmain->is_locked_for_linking == false || ELEM(type, ID_WS, ID_GR, ID_NT)); in lib_id.c

Also related note, current `main` code will assert on `BLI_assert(bmain->is_locked_for_linking == false || ELEM(type, ID_WS, ID_GR, ID_NT));` in `lib_id.c`
Bastien Montagne force-pushed tmp-vse-readfile-cleanup from f11f5374d7 to e7fc6bfdba 2023-08-16 17:49:09 +02:00 Compare
Author
Owner

@blender-bot build

@blender-bot build
Author
Owner

@Sergey @iss think this is now ready for proper review. Test file from @iss does seem to behave properly now, and does not trigger any warning/assert anymore for me.

@Sergey @iss think this is now ready for proper review. Test file from @iss does seem to behave properly now, and does not trigger any warning/assert anymore for me.
Sergey Sharybin refused to review 2023-08-16 17:54:11 +02:00

On a top level seems fine to me. I wouldn't be able to get any deeper check to this. Would be nice if Richard confirms 2.49/2.50 files works fine, as he was able to run those older versions.

On a top level seems fine to me. I wouldn't be able to get any deeper check to this. Would be nice if Richard confirms 2.49/2.50 files works fine, as he was able to run those older versions.

I have tested the file now and it does not play. Path seems to be correct, but looking at properties in side panel it seems that it is not being loaded. Will check what is the issue.

I have tested the file now and it does not play. Path seems to be correct, but looking at properties in side panel it seems that it is not being loaded. Will check what is the issue.

Eh sorry, turns out, that I am dumb and used lite build. File works OK after all.

Eh sorry, turns out, that I am dumb and used lite build. File works OK after all.
Richard Antalik approved these changes 2023-08-17 10:39:07 +02:00
Bastien Montagne merged commit b454fc2161 into main 2023-08-17 16:09:22 +02:00
Bastien Montagne deleted branch tmp-vse-readfile-cleanup 2023-08-17 16:09:23 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111135
No description provided.