]> git.parisson.com Git - timeside.git/commitdiff
Core : add a condition to catch signal only if a LiveDecoder source is used
authorThomas Fillon <thomas@parisson.com>
Mon, 20 Jan 2014 14:59:56 +0000 (15:59 +0100)
committerThomas Fillon <thomas@parisson.com>
Mon, 20 Jan 2014 14:59:56 +0000 (15:59 +0100)
timeside/core.py

index 629d4f4e6e835f5e944236420c0190c1c7f1c7dc..93822609f40d0dc9d93d2865bb2b6ec0484ef600 100644 (file)
@@ -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: