Handle KeyboardInterrupt in the main program, not in the Player class
[vidi-player.git] / vidi / Player.py
index bd826bc..15a4d07 100755 (executable)
@@ -41,21 +41,14 @@ class Player(object):
         pipeline = Gst.parse_launch(pipeline_string)
         return Player(pipeline)
 
-    def quit(self):
+    def stop(self):
         self.mainloop.quit()
         self.pipeline.set_state(Gst.State.NULL)
 
     def bus_message_cb(self, unused_bus, message):
         if message.type == Gst.MessageType.EOS:
-            self.quit()
+            self.stop()
 
     def play(self):
         self.pipeline.set_state(Gst.State.PLAYING)
-
-        try:
-            self.mainloop.run()
-        except KeyboardInterrupt:
-            self.quit()
-            return 1
-
-        return 0
+        self.mainloop.run()