Skip to content

Commit fa61ce8

Browse files
committed
fix: properly close ffmpeg thumb channel
1 parent af3f98c commit fa61ce8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/ffmpeg.ml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
let generate_thumb file_name cache_file =
2-
ignore @@ Unix.open_process_in
3-
@@ Printf.sprintf "ffmpeg -ss 00:00:01 -i \"%s\" -frames:v 1 \"%s\"" file_name
4-
cache_file
2+
let channel =
3+
Unix.open_process_in
4+
@@ Printf.sprintf "ffmpeg -ss 00:00:01 -i \"%s\" -frames:v 1 \"%s\""
5+
file_name cache_file
6+
in
7+
In_channel.close channel
58

69
let thumbnail ~width ~height file =
710
let cache_file = Helpers.get_cache_file file `THUMB in

0 commit comments

Comments
 (0)