From 851f71135798f2e5d7ecd924fd07c462ad4fd6c1 Mon Sep 17 00:00:00 2001 From: Jose Manuel Delicado Date: Fri, 22 Sep 2017 17:38:03 +0200 Subject: [PATCH] Set prepared=False after playing and stopping an audio in URLStream class --- src/sound.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sound.py b/src/sound.py index f170eee3..32f76e23 100644 --- a/src/sound.py +++ b/src/sound.py @@ -109,11 +109,10 @@ class URLStream(object): transformer = audio_services.find_url_transformer(self.url) self.url = transformer(self.url) log.debug("Transformed URL: %s. Prepared" % (self.url,)) - self.prepared = True else: self.url = url log.debug("Transformed URL: %s. Prepared" % (self.url,)) - self.prepared = True + self.prepared = True def seek(self,step): pos=self.stream.get_position() @@ -144,6 +143,7 @@ class URLStream(object): self.stream.volume = float(volume) self.stream.play() log.debug("played") + self.prepared=False def stop_audio(self,delete=False): if hasattr(self, "stream"): @@ -156,6 +156,7 @@ class URLStream(object): if delete: del self.stream log.debug("Deleted audio stream.") + self.prepared=False return True else: return False