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 } #########################