[gnome-music/wip/jfelder/player-fix-stopped-state-change] gstplayer: Fix Change to stopped state
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/player-fix-stopped-state-change] gstplayer: Fix Change to stopped state
- Date: Wed, 24 Feb 2021 18:42:15 +0000 (UTC)
commit e8ccfa64c287d5296a1cde46510dc1131ef9be96
Author: Jean Felder <jfelder src gnome org>
Date: Wed Feb 24 19:35:59 2021 +0100
gstplayer: Fix Change to stopped state
Since commit 703692e9, gstplayer state changes are asynchronous. It
relies on listening to the "state-changed" message from the pipeline
to update its state. However, changing the state to NULL (ie. STOPPED
in gstplayer terminology) flushes the pipeline. Thus, the change
message never arrives.
This results in the playbar staying in a weird state at the end of a
playlist because the STOPPED state change is never recieved (see
This issue is fixed by changing gstplayer state to STOPPED when this
state is requested.
Closes: https://gitlab.gnome.org/GNOME/gnome-music/-/issues/411
gnomemusic/gstplayer.py | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/gnomemusic/gstplayer.py b/gnomemusic/gstplayer.py
index cb248fd88..9d5915218 100644
--- a/gnomemusic/gstplayer.py
+++ b/gnomemusic/gstplayer.py
@@ -224,7 +224,11 @@ class GstPlayer(GObject.GObject):
if state == Playback.PAUSED:
self._player.set_state(Gst.State.PAUSED)
if state == Playback.STOPPED:
+ # Changing the state to NULL flushes the pipeline.
+ # Thus, the change message never arrives.
self._player.set_state(Gst.State.NULL)
+ self._state = Playback.STOPPED
+ self.notify("state")
if state == Playback.LOADING:
self._player.set_state(Gst.State.READY)
if state == Playback.PLAYING:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]