From: Antonio Ospite Date: Mon, 28 Nov 2016 12:22:13 +0000 (+0100) Subject: vidi/Player.py: move the signal callback initialization to the __init__ method X-Git-Url: https://git.ao2.it/vidi-player.git/commitdiff_plain/f18fd9fc68975962863c048b5ca11586f3f26fd6?hp=d4d41f13508af2043b3934797bbd1e57bc2df5cc vidi/Player.py: move the signal callback initialization to the __init__ method --- diff --git a/vidi/Player.py b/vidi/Player.py index 26a9832..bd826bc 100755 --- a/vidi/Player.py +++ b/vidi/Player.py @@ -30,6 +30,10 @@ GObject.threads_init() class Player(object): def __init__(self, pipeline): self.pipeline = pipeline + bus = self.pipeline.get_bus() + bus.add_signal_watch() + bus.connect("message", self.bus_message_cb) + self.mainloop = GObject.MainLoop() @staticmethod @@ -46,10 +50,6 @@ class Player(object): self.quit() def play(self): - bus = self.pipeline.get_bus() - bus.add_signal_watch() - bus.connect("message", self.bus_message_cb) - self.pipeline.set_state(Gst.State.PLAYING) try: