diff --git a/mopidy/audio/actor.py b/mopidy/audio/actor.py index 834bee55..db923e6d 100644 --- a/mopidy/audio/actor.py +++ b/mopidy/audio/actor.py @@ -746,6 +746,7 @@ class Audio(pykka.ThreadingActor): # Default to blank data to trick shoutcast into clearing any previous # values it might have. + # TODO: Verify if this works at all, likely it doesn't. set_value(Gst.TAG_ARTIST, ' ') set_value(Gst.TAG_TITLE, ' ') set_value(Gst.TAG_ALBUM, ' ') diff --git a/mopidy/audio/scan.py b/mopidy/audio/scan.py index 0b6831ea..c63405b0 100644 --- a/mopidy/audio/scan.py +++ b/mopidy/audio/scan.py @@ -137,6 +137,11 @@ def _start_pipeline(pipeline): def _query_duration(pipeline, timeout=100): + # 1. Try and get a duration, return if success. + # 2. Some formats need to play some buffers before duration is found. + # 3. Wait for a duration change event. + # 4. Try and get a duration again. + success, duration = pipeline.query_duration(Gst.Format.TIME) if success and duration >= 0: return duration // Gst.MSECOND