Skip to content

Commit 5d98578

Browse files
committed
fix: drawing was ending at 80% most of the time
1 parent 5b37715 commit 5d98578

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: lib/ffbar.ml

+5-4
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,20 @@ let read_commands chan video user_duration user_seek =
5252
(constf " %s"
5353
String.(sub video.name 0 (min 23 (length video.name))) )
5454
; percentage_of total
55-
; bar ~style:`ASCII total
55+
; bar ~style:`ASCII ~data:`Sum total
5656
; const "-" ++ eta total ++ const " " ]
5757
in
58-
let prev = ref 0.0 in
58+
let prev = ref 0 in
5959
let quit = ref false in
6060
Progress.with_reporter bar (fun f ->
6161
while not !quit do
6262
match read_command chan with
6363
| Eof | ParsingError ->
6464
quit := true (* FIXME: handle parsing error *)
6565
| Nop -> ()
66-
| Timestamp timestamp ->
67-
f (Float.to_int (timestamp -. !prev)) ;
66+
| Timestamp tt ->
67+
let timestamp = Float.to_int tt in
68+
f (timestamp - !prev) ;
6869
prev := timestamp
6970
done ) ;
7071
Ok () )

0 commit comments

Comments
 (0)