[gnome-music/gbsneto/untangle-player-window-mpris: 7/9] 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: 7/9] player: Only initialize Gst once
- Date: Wed, 10 Apr 2019 15:41:20 +0000 (UTC)
commit 1665c047b044f6ff67e3990da8ba330092932a8f
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.
Move all Gst initialization (including GstPbutils) to
gstplayer.py.
gnomemusic/gstplayer.py | 1 +
gnomemusic/player.py | 5 +----
2 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/gstplayer.py b/gnomemusic/gstplayer.py
index 4bc3ee09..5a6ff0f8 100644
--- a/gnomemusic/gstplayer.py
+++ b/gnomemusic/gstplayer.py
@@ -65,6 +65,7 @@ class GstPlayer(GObject.GObject):
super().__init__()
Gst.init(None)
+ GstPbutils.pb_utils_init()
self._application = application
self._duration = -1.
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 7429d270..b08b9757 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
@@ -579,9 +579,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]