Skip to content

feat: add optional scene detection cancellation - #219

Merged
shssoichiro merged 1 commit into
rust-av:masterfrom
BoatsMcGee:scd-cancel
Sep 4, 2026
Merged

shssoichiro merged 1 commit into
rust-av:masterfrom
BoatsMcGee:scd-cancel

Conversation

@BoatsMcGee

Copy link
Copy Markdown
Contributor

Adds an optional AtomicBool parameter to detect_scene_changes() that can be set to true by the caller at any time to cancel scene detection.

Without this the only way to "cancel" scene detection is to exit the program entirely which is at best not graceful and at worst unacceptable for interactive applications.

Example

fn example(cancelled: Arc<AtomicBool>) -> Result<stuff> {
...
detect_scene_changes::<u16>(
    input.decoder(),
    options,
    None,
    Some(&callback),
    Some(Arc::clone(&cancelled)),
)
...
if cancelled.load(Ordering::Relaxed) {
    return Ok(());
}

Thanks,
- Boats M.

@BoatsMcGee

Copy link
Copy Markdown
Contributor Author

I just realized I could perhaps add CTRL+C handling in main.rs but my priority is the library and not the CLI which I consider to just be a demo/example. Let me know if you want that in this PR or we can just table it for another time.

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.97%. Comparing base (de8a737) to head (b5d1ecf).

Files with missing lines Patch % Lines
src/lib.rs 0.00% 5 Missing ⚠️
src/main.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #219      +/-   ##
==========================================
- Coverage   26.01%   25.97%   -0.05%     
==========================================
  Files          31       31              
  Lines        3029     3034       +5     
==========================================
  Hits          788      788              
- Misses       2241     2246       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shssoichiro
shssoichiro merged commit b80e324 into rust-av:master Sep 4, 2026
5 of 7 checks passed
@BoatsMcGee
BoatsMcGee deleted the scd-cancel branch October 31, 2026 03:25
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