Skip to content

Fix fx_cut affected video tracks above it - #1290

Merged
ddennedy merged 6 commits into
masterfrom
fx_cut
Sep 4, 2026
Merged

Fix fx_cut affected video tracks above it#1290
ddennedy merged 6 commits into
masterfrom
fx_cut

Conversation

@ddennedy

@ddennedy ddennedy commented Sep 3, 2026

Copy link
Copy Markdown
Member

Adds 2 new functions:
mlt_frame_prepend_image_from_service()
mlt_frame_push_image_with_fx_cut()

Adds 2 new functions:
`mlt_frame_get_image_from_service()`
`mlt_frame_get_image_with_fx_cut()`
@ddennedy ddennedy added this to the v7.42.0 milestone Sep 3, 2026
@ddennedy
ddennedy requested a balanced review from Copilot September 3, 2026 22:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

FX cuts can become ineffective without a transition or when transition tracks are reversed.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates fx_cut routing so filters affect only lower tracks while higher tracks composite afterward.

Changes:

  • Adds reusable frame image-routing callbacks.
  • Moves FX routing into transition processing.
  • Adds regression tests, API exports, and documentation.
File summaries
File Description
NEWS Documents the corrected behavior and APIs.
src/framework/mlt.vers Exports the new callbacks.
src/framework/mlt_frame.c Implements image sharing and FX routing.
src/framework/mlt_frame.h Declares the new public APIs.
src/framework/mlt_playlist.h Documents track-order behavior.
src/framework/mlt_tractor.c Changes FX handling during track stacking.
src/framework/mlt_transition.c Applies FX filters to lower-track frames.
src/tests/test_tractor/test_tractor.cpp Tests FX track ordering and standalone behavior.
Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/framework/mlt_tractor.c Outdated
Comment thread src/framework/mlt_transition.c
Comment thread src/framework/mlt_playlist.h

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Image ownership leaks and an uncovered higher-track routing case remain.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

src/framework/mlt_frame.c:1124

  • When an fx filter edits the underlying image in place, src and dst hold the same pointer here. Calling mlt_frame_set_image(dst, image, ..., NULL) with that same pointer clears dst's existing destructor (mlt_property_set_data() does this at src/framework/mlt_property.c:308-315), while the fx frame only has a non-owning reference. The final share-back therefore leaks the image buffer on every such frame. Preserve the existing ownership when the pointers are identical.
    int size = 0;
    uint8_t *image = mlt_properties_get_data(MLT_FRAME_PROPERTIES(src), "image", &size);
    mlt_frame_set_image(dst, image, 0, NULL);
    copy_image_state(dst, src);
  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread src/framework/mlt_frame.c Outdated
Comment thread src/framework/mlt_tractor.c

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Image-state sharing can preserve stale optional data or copy a stale image property instead of the returned buffer.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread src/framework/mlt_frame.c Outdated
Comment thread src/framework/mlt_frame.c Outdated
ddennedy and others added 2 commits September 3, 2026 17:12
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Transition routing can still bypass ordinary lower-index tracks positioned between the selected A frame and an adjustment clip.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/framework/mlt_transition.c Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The updated implementation addresses the prior findings and includes broad regression coverage for the affected routing scenarios.

Review details
  • Files reviewed: 8/8 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@ddennedy
ddennedy merged commit 91cc63c into master Sep 4, 2026
16 checks passed
@ddennedy
ddennedy deleted the fx_cut branch September 4, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants