1
0
Fork 0

Do not fail if ffmpeg was already killed.

liquidsoap-2.2
Icedream 2021-03-07 22:21:57 +01:00
parent e6cb55f15d
commit 95ee555ebc
Signed by: icedream
GPG Key ID: 468BBEEBB9EC6AEA
1 changed files with 4 additions and 4 deletions

View File

@ -15,8 +15,8 @@ daemon_ffmpeg() {
shutdown_ffmpeg() { shutdown_ffmpeg() {
if is_ffmpeg_running if is_ffmpeg_running
then then
kill "$ffmpeg_pid" kill "$ffmpeg_pid" || true
wait "$ffmpeg_pid" wait "$ffmpeg_pid" || true
fi fi
ffmpeg_pid= ffmpeg_pid=
} }
@ -60,11 +60,11 @@ do
echo "starting ffmpeg with audio source: $found_audio_source" >&2 echo "starting ffmpeg with audio source: $found_audio_source" >&2
# HACK - can't use the standard mpegts here, but liquidsoap will happily accept anything ffmpeg can parse (by default)… so let's just use nut here even though it feels super duper wrong # HACK - can't use the standard mpegts here, but liquidsoap will happily accept anything ffmpeg can parse (by default)… so let's just use nut here even though it feels super duper wrong
daemon_ffmpeg -loglevel warning -extra_ips 192.168.188.21 -f libndi_newtek -i "$found_audio_source" -c copy -f nut -write_index false "${target_url}" daemon_ffmpeg -loglevel warning -extra_ips 192.168.188.21 -f libndi_newtek -i "$found_audio_source" -c copy -f nut -write_index false "${target_url}"
elif is_ffmpeg_running && [ -z "$found_audio_source" ] && [ "$offline" -gt 3 ] elif is_ffmpeg_running && [ -z "$found_audio_source" ] && [ "$offline" -gt 0 ]
then then
echo "shutting down ffmpeg since no source has been found" >&2 echo "shutting down ffmpeg since no source has been found" >&2
shutdown_ffmpeg # it won't shut down by itself unfortunately shutdown_ffmpeg # it won't shut down by itself unfortunately
fi fi
sleep 3 sleep 1
done done