From 6c52282b717d862bf68962a0dfa9721d7eecb535 Mon Sep 17 00:00:00 2001 From: Thomas Fillon Date: Mon, 20 Jan 2014 15:59:56 +0100 Subject: [PATCH] Core : add a condition to catch signal only if a LiveDecoder source is used --- timeside/core.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/timeside/core.py b/timeside/core.py index 629d4f4..9382260 100644 --- a/timeside/core.py +++ b/timeside/core.py @@ -300,21 +300,23 @@ class ProcessPipe(object): # now stream audio data along the pipe eod = False - # Set handler for Interruption signal - import signal + if source.id() == 'gst_live_dec': + # Set handler for Interruption signal + import signal - def signal_handler(signum, frame): - source.stop() + def signal_handler(signum, frame): + source.stop() - signal.signal(signal.SIGINT, signal_handler) + signal.signal(signal.SIGINT, signal_handler) while not eod: frames, eod = source.process() for item in items: frames, eod = item.process(frames, eod) - # Restore default handler for Interruption signal - signal.signal(signal.SIGINT, signal.SIG_DFL) + if source.id() == 'gst_live_dec': + # Restore default handler for Interruption signal + signal.signal(signal.SIGINT, signal.SIG_DFL) # Post-processing for item in items: -- 2.39.5