From 5277ad5ff573bd0d4b1256bd1c3d022fcc4c3877 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Mon, 26 Oct 2015 21:54:01 +0100 Subject: [PATCH] gst1: Update get_enum() to include enum type it expects --- mopidy/audio/actor.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mopidy/audio/actor.py b/mopidy/audio/actor.py index c51449c5..e2ee4041 100644 --- a/mopidy/audio/actor.py +++ b/mopidy/audio/actor.py @@ -305,8 +305,10 @@ class _Handler(object): self._audio._playbin, Gst.DebugGraphDetails.ALL, 'mopidy') def on_buffering(self, percent, structure=None): - if structure and structure.has_field('buffering-mode'): - if structure.get_enum('buffering-mode') == Gst.BufferingMode.LIVE: + if structure is not None and structure.has_field('buffering-mode'): + buffering_mode = structure.get_enum( + 'buffering-mode', Gst.BufferingMode) + if buffering_mode == Gst.BufferingMode.LIVE: return # Live sources stall in paused. level = logging.getLevelName('TRACE')