From e57f3f39c43a8f9aaf61558dc36565f8fa6048ce Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Mon, 2 May 2011 23:49:39 +0200 Subject: [PATCH] Short circuit retrival of position when we are in stopped state, should fix #87 --- mopidy/gstreamer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mopidy/gstreamer.py b/mopidy/gstreamer.py index 7b444df2..ddcc6a56 100644 --- a/mopidy/gstreamer.py +++ b/mopidy/gstreamer.py @@ -169,6 +169,8 @@ class GStreamer(ThreadingActor): self.gst_pipeline.get_by_name('source').emit('end-of-stream') def get_position(self): + if self.gst_pipeline.get_state()[1] == gst.STATE_NULL: + return 0 try: position = self.gst_pipeline.query_position(gst.FORMAT_TIME)[0] return position // gst.MSECOND