X-Git-Url: https://git.ao2.it/vidi-player.git/blobdiff_plain/9a8f764328f6b47707ed24acc9a5e2fc9a4fcf57..d2933a9ba8a8813900e05b4051b625180b01958c:/vidi/Player.py diff --git a/vidi/Player.py b/vidi/Player.py index 58c3ece..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 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.stop() def play(self): self.pipeline.set_state(Gst.State.PLAYING) + self.mainloop.run() - try: - self.mainloop.run() - except KeyboardInterrupt: - self.stop() - return 1 - - return 0 + def stop(self): + self.mainloop.quit() + self.pipeline.set_state(Gst.State.NULL)