X-Git-Url: https://git.ao2.it/vidi-player.git/blobdiff_plain/f18fd9fc68975962863c048b5ca11586f3f26fd6..89d6d61324d22afd1f441c9b01956645c4305fe0:/vidi/Player.py diff --git a/vidi/Player.py b/vidi/Player.py index bd826bc..cf30f9f 100755 --- a/vidi/Player.py +++ b/vidi/Player.py @@ -41,21 +41,14 @@ class Player(object): pipeline = Gst.parse_launch(pipeline_string) return Player(pipeline) - def quit(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) + self.mainloop.run() - try: - self.mainloop.run() - except KeyboardInterrupt: - self.quit() - return 1 - - return 0 + def stop(self): + self.mainloop.quit() + self.pipeline.set_state(Gst.State.NULL)