diff --git a/src/ambianic/pipeline/avsource/av_element.py b/src/ambianic/pipeline/avsource/av_element.py index 0916d383..9736587e 100755 --- a/src/ambianic/pipeline/avsource/av_element.py +++ b/src/ambianic/pipeline/avsource/av_element.py @@ -133,9 +133,9 @@ def _stop_gst_service(self): log.debug('Gst proess did not terminate.' ' Resorting to force kill.') gst_proc.kill() - while gst_proc.is_alive(): - time.sleep(1) - log.debug('Gst process stopped after kill signal.') + # while gst_proc.is_alive(): + # time.sleep(1) + log.debug('Gst process killed.') else: log.debug('Gst process stopped after terminate signal.') else: diff --git a/src/ambianic/pipeline/avsource/gst_process.py b/src/ambianic/pipeline/avsource/gst_process.py index 0e556b08..54c085e6 100644 --- a/src/ambianic/pipeline/avsource/gst_process.py +++ b/src/ambianic/pipeline/avsource/gst_process.py @@ -276,7 +276,8 @@ def _gst_cleanup(self): def _service_shutdown(self, signum, frame): log.info('GST service caught system shutdown signal %d', signum) - self._gst_cleanup() + if not self._stop_signal.is_set(): + self._stop_signal.set() def _stop_handler(self): self._stop_signal.wait()