[gnome-music/wip/jfelder/fix-player-pause-change: 2/2] player: Fix song change while player is on pause
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/fix-player-pause-change: 2/2] player: Fix song change while player is on pause
- Date: Wed, 30 Jan 2019 07:48:38 +0000 (UTC)
commit e0994ad455ecb3f870bf331c3bc5a9ebf3040073
Author: Jean Felder <jfelder src gnome org>
Date: Wed Jan 30 08:35:30 2019 +0100
player: Fix song change while player is on pause
When the player is on pause, it's impossible to change the current
song. Indeed, play method checks the player's state but does not check
if gstplayer's url has changed (which means that a new song has been
loaded).
Checking that the url has changed instead of the player state fixes
the issue.
Closes: #266
gnomemusic/player.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 7e72bcc9..81852529 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -628,9 +628,7 @@ class Player(GObject.GObject):
self._gst_player.props.state = Playback.LOADING
self._time_stamp = int(time.time())
- url_ = song.get_url()
- if url_ != self._gst_player.props.url:
- self._gst_player.props.url = url_
+ self._gst_player.props.url = song.get_url()
self.emit('song-changed', self._playlist.get_current_index())
@@ -661,7 +659,8 @@ class Player(GObject.GObject):
and not self._playlist.set_song(song_offset)):
return False
- if self.props.state != Playback.PAUSED:
+ url = self._playlist.props.current_song.get_url()
+ if url != self._gst_player.props.url:
self._load(self._playlist.props.current_song)
self._gst_player.props.state = Playback.PLAYING
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]