From 3183f43b18955a55b41b953502e49b67229ecf0f Mon Sep 17 00:00:00 2001 From: SeeSpotRun Date: Tue, 15 Mar 2016 14:42:29 +1000 Subject: [PATCH] scanner: workaround for gstreamer not pushing tags before PREROLL refer https://bugzilla.gnome.org/show_bug.cgi?id=763553 --- mopidy/audio/scan.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mopidy/audio/scan.py b/mopidy/audio/scan.py index c63405b0..1a199e58 100644 --- a/mopidy/audio/scan.py +++ b/mopidy/audio/scan.py @@ -210,8 +210,11 @@ def _process(pipeline, timeout_ms): elif message.type == Gst.MessageType.EOS: return tags, mime, have_audio elif message.type == Gst.MessageType.ASYNC_DONE: - if message.src == pipeline: + if tags: return tags, mime, have_audio + else: + # workaround for https://bugzilla.gnome.org/show_bug.cgi?id=763553: + pipeline.set_state(Gst.State.PLAYING) elif message.type == Gst.MessageType.TAG: taglist = message.parse_tag() # Note that this will only keep the last tag. @@ -220,6 +223,9 @@ def _process(pipeline, timeout_ms): now = int(time.time() * 1000) timeout -= now - previous previous = now + # workaround for https://bugzilla.gnome.org/show_bug.cgi?id=763553: + if tags: + pipeline.set_state(Gst.State.PAUSED) raise exceptions.ScannerError('Timeout after %dms' % timeout_ms)