@@ -65,6 +65,7 @@ class cross val_source ~duration_getter ~override_duration ~persist_override
65
65
* Going with the same choice as above for now. *)
66
66
method self_sync = s#self_sync
67
67
val mutable cross_length = Lazy. force Frame. size
68
+ val mutable rejected_cross_length = None
68
69
val mutable duration_getter = original_duration_getter
69
70
method cross_duration = duration_getter ()
70
71
@@ -73,16 +74,19 @@ class cross val_source ~duration_getter ~override_duration ~persist_override
73
74
let main_new_cross_length = Frame. main_of_seconds new_cross_length in
74
75
75
76
if main_new_cross_length <> cross_length then
76
- if new_cross_length < 0. then
77
- self#log#important
78
- " Cannot set crossfade duration to negative value %f!"
79
- new_cross_length
77
+ if new_cross_length < = 0. then (
78
+ if rejected_cross_length <> Some new_cross_length then (
79
+ self#log#critical " Invalid cross duration: %.2f <= 0.!"
80
+ new_cross_length;
81
+ rejected_cross_length < - Some new_cross_length);
82
+ cross_length < - Lazy. force Frame. size)
80
83
else (
81
84
let main_new_cross_length =
82
85
max (Lazy. force Frame. size) main_new_cross_length
83
86
in
84
87
self#log#info " Setting crossfade duration to %.2fs"
85
88
(Frame. seconds_of_main main_new_cross_length);
89
+ rejected_cross_length < - None ;
86
90
cross_length < - main_new_cross_length)
87
91
88
92
initializer self#set_cross_length
0 commit comments