Skip to content

Commit

Permalink
Check if before source is ready in crossfade before returning it. (#4177
Browse files Browse the repository at this point in the history
)
  • Loading branch information
toots committed Jan 3, 2025
1 parent 5acc01e commit dab14b2
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit dab14b2

Please sign in to comment.