Commits

Damián Nohales committed 83de331

Stop button shows permanently the buffering image when buffering again.

Comments (0)

Files changed (1)

         return self.playlist.get_song_iter(self.get_playing_song())
     
     def on_player_message(self, bus, message):
-        if message.type == gst.MESSAGE_BUFFERING and not self.is_buffering:
-            self.button_play.set_image(self.widget_image_buffering)
-            self.is_buffering = True
+        if message.type == gst.MESSAGE_BUFFERING:
+            if message.parse_buffering() >= 100:
+                self.is_buffering = False
+                self.button_play.set_image(self.widget_image_stop)
+            elif not self.is_buffering:
+                self.button_play.set_image(self.widget_image_buffering)
+                self.is_buffering = True
         elif message.type == gst.MESSAGE_EOS:
             self.play_next()
-        elif message.type == gst.MESSAGE_ASYNC_DONE:
-            self.is_buffering = False
-            self.button_play.set_image(self.widget_image_stop)
             
     def on_player_idle(self):
         try: