Permalink
Browse files

audio: Disable buffering handling during track change. (Fixes mopidy#…

  • Loading branch information...
kingosticks committed Jan 30, 2019
1 parent bfb3837 commit 6241201e06fb8a8b293b4d591ae17ab17ecfc871
Showing with 7 additions and 0 deletions.
  1. +7 −0 mopidy/audio/actor.py
@@ -286,6 +286,10 @@ def on_buffering(self, percent, structure=None):
if buffering_mode == Gst.BufferingMode.LIVE:
return # Live sources stall in paused.

if not self._audio._enable_buffering:
gst_logger.info('Skip buffering during track change.')
return

level = logging.getLevelName('TRACE')
if percent < 10 and not self._audio._buffering:
self._audio._playbin.set_state(Gst.State.PAUSED)
@@ -413,6 +417,7 @@ def __init__(self, config, mixer):
self._config = config
self._target_state = Gst.State.NULL
self._buffering = False
self._enable_buffering = False
self._tags = {}
self._pending_uri = None
self._pending_tags = None
@@ -670,6 +675,7 @@ def start_playback(self):
:rtype: :class:`True` if successfull, else :class:`False`
"""
self._enable_buffering = True;
return self._set_state(Gst.State.PLAYING)

def pause_playback(self):
@@ -689,6 +695,7 @@ def prepare_change(self):
is that GStreamer will reset all its state when it changes to
:attr:`Gst.State.READY`.
"""
self._enable_buffering = False
return self._set_state(Gst.State.READY)

def stop_playback(self):

0 comments on commit 6241201

Please sign in to comment.