projects
/
vidi-player.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6260f5e
)
Handle KeyboardInterrupt in the main program, not in the Player class
author
Antonio Ospite <ao2@ao2.it>
Mon, 28 Nov 2016 12:35:58 +0000
(13:35 +0100)
committer
Antonio Ospite <ao2@ao2.it>
Mon, 28 Nov 2016 12:37:30 +0000
(13:37 +0100)
vidi-player.py
patch
|
blob
|
history
vidi/Player.py
patch
|
blob
|
history
diff --git
a/vidi-player.py
b/vidi-player.py
index
04c8941
..
62ae575
100755
(executable)
--- a/
vidi-player.py
+++ b/
vidi-player.py
@@
-105,7
+105,11
@@
def main():
if len(sys.argv) > 3:
timeline.save(sys.argv[3])
else:
if len(sys.argv) > 3:
timeline.save(sys.argv[3])
else:
- timeline.play()
+ try:
+ timeline.play()
+ except KeyboardInterrupt:
+ timeline.stop()
+ return 1
if __name__ == "__main__":
if __name__ == "__main__":
diff --git
a/vidi/Player.py
b/vidi/Player.py
index
58c3ece
..
15a4d07
100755
(executable)
--- a/
vidi/Player.py
+++ b/
vidi/Player.py
@@
-51,11
+51,4
@@
class Player(object):
def play(self):
self.pipeline.set_state(Gst.State.PLAYING)
def play(self):
self.pipeline.set_state(Gst.State.PLAYING)
-
- try:
- self.mainloop.run()
- except KeyboardInterrupt:
- self.stop()
- return 1
-
- return 0
+ self.mainloop.run()