Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if before source is ready in crossfade before returning it. #4177

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/core/operators/cross.ml
Original file line number Diff line number Diff line change
Expand Up @@ -276,12 +276,12 @@ class cross val_source ~end_duration_getter ~override_end_duration
self#prepare_source before;
status <- `Before (before :> Source.source);
self#buffer_before ~is_first:true ();
before
if before#is_ready then Some before else None

method private get_source ~reselect () =
let reselect = match reselect with `Force -> `Ok | _ -> reselect in
match status with
| `Idle when source#is_ready -> Some self#prepare_before
| `Idle when source#is_ready -> self#prepare_before
| `Idle -> None
| `Before _ -> (
self#buffer_before ~is_first:false ();
Expand All @@ -294,7 +294,7 @@ class cross val_source ~end_duration_getter ~override_end_duration
| `After after_source -> Some after_source)
| `After after_source when self#can_reselect ~reselect after_source ->
Some after_source
| `After _ -> Some self#prepare_before
| `After _ -> self#prepare_before

method private buffer_before ~is_first () =
if Generator.length gen_before < end_main_duration && source#is_ready then (
Expand Down
Loading