From f72619aeaea11e24ad1bdb51d87ffd6769141fd9 Mon Sep 17 00:00:00 2001 From: David Baelde Date: Tue, 3 Jul 2012 22:26:11 +0200 Subject: [PATCH] Fix the condition in on_end to properly handle unknown remaining time and unforeseen end of tracks. --- src/operators/on_end.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/operators/on_end.ml b/src/operators/on_end.ml index c719fda439..8792568412 100644 --- a/src/operators/on_end.ml +++ b/src/operators/on_end.ml @@ -22,7 +22,7 @@ class on_end ~kind ~delay f s = object (self) - inherit Source.operator kind [s] + inherit Source.operator ~name:"on_end" kind [s] val mutable executed = false @@ -41,7 +41,7 @@ object (self) if List.length l > 0 then latest_metadata <- Some (snd (List.hd l)); let rem = Frame.seconds_of_master s#remaining in - if rem <= delay && not executed then + if (not executed) && ((0. <= rem && rem <= delay) || Frame.is_partial ab) then begin let m = match latest_metadata with @@ -49,7 +49,7 @@ object (self) | None -> Hashtbl.create 0 in ignore(Lang.apply ~t:Lang.unit_t f ["",Lang.float rem; - "",Lang.metadata m]) ; + "",Lang.metadata m]) ; executed <- true end ; if Frame.is_partial ab then