From 5bc3b1624ce4a021e6d94fbe6403d9c261bf64bd Mon Sep 17 00:00:00 2001 From: Alex <15526962+AlexPresso@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:20:06 +0200 Subject: [PATCH] Remove gstreamer limitation to Armv8 CPUs (#75) * Remove gstreamer limitation to Armv8 CPUs * Improve CodecPack patching * Fix orphan processes --- motd.txt | 2 ++ patcher.sh | 34 ++++++++++++++++++++-------------- wrappers/ffmpeg.sh | 6 ++++++ wrappers/gst-inspect-1.0.sh | 10 +++++++++- wrappers/gst-launch-1.0.sh | 10 +++++++++- 5 files changed, 46 insertions(+), 16 deletions(-) diff --git a/motd.txt b/motd.txt index f2d41ce..12c26f6 100644 --- a/motd.txt +++ b/motd.txt @@ -1,3 +1,5 @@ The patcher now supports every scenarios including gstreamer (credits to @nap-liu). +A process leak was identified and fixed, performances should be better when changing video time. + As always, please let me know of any issue you could have. diff --git a/patcher.sh b/patcher.sh index 59d50fb..5604f06 100755 --- a/patcher.sh +++ b/patcher.sh @@ -5,7 +5,6 @@ ############################### source "/etc/VERSION" -cpu_platform=$(> $logfile newline + errcode=1 endprocess } @@ -34,7 +37,12 @@ function endprocess() { info "========================================[end gst $pid]" newline rm "$stderrfile" - exit 1 + + if [[ "$child" != "" ]]; then + kill -9 "$child" + fi + + exit $errcode } ######################### diff --git a/wrappers/gst-launch-1.0.sh b/wrappers/gst-launch-1.0.sh index dc45914..0f77301 100644 --- a/wrappers/gst-launch-1.0.sh +++ b/wrappers/gst-launch-1.0.sh @@ -5,8 +5,10 @@ ######################### pid=$$ +child="" stderrfile="/tmp/gstlaunch-$pid.stderr" logfile="/tmp/gstreamer.log" +errcode=0 ######################### # UTILS @@ -27,6 +29,7 @@ function handle_error() { newline cat "$stderrfile" >> $logfile newline + errcode=1 endprocess } @@ -34,7 +37,12 @@ function endprocess() { info "========================================[end gst $pid]" newline rm "$stderrfile" - exit 1 + + if [[ "$child" != "" ]]; then + kill -9 "$child" + fi + + exit $errcode } #########################