[gnome-music/gbsneto/untangle-player-window-mpris: 9/10] player: Only initialize Gst once
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/gbsneto/untangle-player-window-mpris: 9/10] player: Only initialize Gst once
- Date: Fri, 12 Apr 2019 12:58:37 +0000 (UTC)
commit b6da22fc2d19edda0485c8083eff4928258d46e2
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Apr 10 12:13:02 2019 -0300
player: Only initialize Gst once
A small harmless point noticed while cleaning this code,
we are initializing Gst twice. This is harmless, but it
is good to tight things up.
Make Gst be initialized by GstPlayer, and GstPbutils, by
PlayperPlaylist.
gnomemusic/player.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 7429d270..cc15397c 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -33,7 +33,7 @@ import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstAudio', '1.0')
gi.require_version('GstPbutils', '1.0')
-from gi.repository import Gio, GLib, GObject, Grl, Gst, GstPbutils
+from gi.repository import Gio, GLib, GObject, Grl, GstPbutils
from gnomemusic import log
from gnomemusic.gstplayer import GstPlayer, Playback
@@ -97,6 +97,9 @@ class PlayerPlaylist(GObject.GObject):
@log
def __init__(self):
super().__init__()
+
+ GstPbutils.pb_utils_init()
+
self._songs = []
self._shuffle_indexes = []
self._current_index = 0
@@ -579,9 +582,6 @@ class Player(GObject.GObject):
self._new_clock = True
- Gst.init(None)
- GstPbutils.pb_utils_init()
-
self._gst_player = GstPlayer(application)
self._gst_player.connect('clock-tick', self._on_clock_tick)
self._gst_player.connect('eos', self._on_eos)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]