From: Thomas Fillon Date: Mon, 20 Jan 2014 14:59:56 +0000 (+0100) Subject: Core : add a condition to catch signal only if a LiveDecoder source is used X-Git-Tag: 0.5.3~19^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=6c52282b717d862bf68962a0dfa9721d7eecb535;p=timeside.git Core : add a condition to catch signal only if a LiveDecoder source is used --- 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: