1
0
Fork 0

Listen for ffmpeg process via loop.

master
Icedream 2021-10-12 20:32:57 +02:00
parent 136ec78138
commit 067ccb5b3b
Signed by: icedream
GPG Key ID: 468BBEEBB9EC6AEA
1 changed files with 12 additions and 1 deletions

View File

@ -16,7 +16,18 @@ shutdown_ffmpeg() {
if is_ffmpeg_running
then
kill "$ffmpeg_pid" || true
wait "$ffmpeg_pid" || true
for t in $(seq 0 10)
do
if ! kill -0 "$ffmpeg_pid"
then
break
fi
sleep 1
done
if kill -0 "$ffmpeg_pid"
then
kill -9 "$ffmpeg_pid" || true
fi
fi
ffmpeg_pid=
}