From bb4eee369d24798a046039e043b9ebd0987cce17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Mon, 26 Jul 2021 17:55:47 +0100 Subject: [PATCH] Use thread-safe call to `ffmpeg` in Julia v1.6 --- src/FFMPEG.jl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/FFMPEG.jl b/src/FFMPEG.jl index c81bdbe..5c809a8 100644 --- a/src/FFMPEG.jl +++ b/src/FFMPEG.jl @@ -103,13 +103,12 @@ built with clang version 6.0.1 (tags/RELEASE_601/final) ``` """ function exe(arg::Cmd; command = ffmpeg, collect = false) - if collect - command() do command_path - collectexecoutput(`$command_path $arg`) - end + f = collect ? collectexecoutput : Base.run + @static if VERSION ≥ v"1.6" + f(`$(command()) $arg`) else command() do command_path - Base.run(`$command_path $arg`) + f(`$command_path $arg`) end end end