From: Guillaume Pellerin Date: Tue, 23 Jul 2013 03:09:13 +0000 (+0200) Subject: cleanup X-Git-Tag: 0.3~22 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=251c093ed2594ffb2bf190c39ec7be3481e0dfa1;p=piplayer.git cleanup --- diff --git a/piplayer.py b/piplayer.py index 1048e52..2bc4854 100644 --- a/piplayer.py +++ b/piplayer.py @@ -133,10 +133,7 @@ class AudioPlayer(object): pad.link(self.apad) def on_eos(self, bus, msg): - #print 'on_eos' - self.pipeline.set_state(gst.STATE_NULL) - self.playing = False - #self.mainloop.quit() + self.stop() def on_tag(self, bus, msg): taglist = msg.parse_tag() @@ -151,7 +148,6 @@ class AudioPlayer(object): def play(self): if not self.playing: - self.pipeline.set_state(gst.STATE_NULL) self.pipeline.set_state(gst.STATE_PLAYING) self.playing = True @@ -180,6 +176,9 @@ class AudioPlayer(object): def run(self): self.mainloop.run() + def quit(self): + self.mainloop.quit() + if __name__ == '__main__': if len(sys.argv) <= 1: