Skip to content

Commit

Permalink
Fix the condition in on_end to properly handle unknown remaining time…
Browse files Browse the repository at this point in the history
… and

unforeseen end of tracks.
  • Loading branch information
dbaelde committed Jul 3, 2012
1 parent d234427 commit f72619a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/operators/on_end.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -41,15 +41,15 @@ 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
| Some m -> m
| 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
Expand Down

0 comments on commit f72619a

Please sign in to comment.