From 4adea37e970a4e5082366b6d2b1861e2d1006245 Mon Sep 17 00:00:00 2001 From: Thomas Adamcik Date: Tue, 25 Oct 2016 21:41:42 +0200 Subject: [PATCH] audio: Give up getting duration for MMS (Fixes: #1553) --- mopidy/audio/scan.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mopidy/audio/scan.py b/mopidy/audio/scan.py index e448fe14..a2bf73b4 100644 --- a/mopidy/audio/scan.py +++ b/mopidy/audio/scan.py @@ -249,6 +249,12 @@ def _process(pipeline, timeout_ms): if result == Gst.StateChangeReturn.FAILURE: return tags, mime, have_audio, duration + # Try again to get duration since we changed without async, then + # just give up as there is nothing more that can happen. + if result == Gst.StateChangeReturn.SUCCESS: + _, duration = _query_duration(pipeline) + return tags, mime, have_audio, duration + elif msg.type == Gst.MessageType.DURATION_CHANGED: # duration will be read after ASYNC_DONE received; for now # just give it a non-None value to flag that we have a duration: