audio: Disable buffering handling during track change. (Fixes #1722).
Skip handling buffering messages if pipeline not PLAYING or PAUSED.
This commit is contained in:
parent
3e40f918c9
commit
dfbab4bf88
@ -13,6 +13,9 @@ Bug fix release.
|
|||||||
- Audio: Fix switching between tracks with different sample rates. (Fixes:
|
- Audio: Fix switching between tracks with different sample rates. (Fixes:
|
||||||
:issue:`1528`, PR: :issue:`1735`)
|
:issue:`1528`, PR: :issue:`1735`)
|
||||||
|
|
||||||
|
- Audio: Prevent buffering handling interfering with track changes. (Fixes:
|
||||||
|
:issue:`1722`, PR: :issue:`1740`)
|
||||||
|
|
||||||
v2.2.2 (2018-12-29)
|
v2.2.2 (2018-12-29)
|
||||||
===================
|
===================
|
||||||
|
|
||||||
|
|||||||
@ -274,6 +274,10 @@ class _Handler(object):
|
|||||||
self._audio._playbin, Gst.DebugGraphDetails.ALL, 'mopidy')
|
self._audio._playbin, Gst.DebugGraphDetails.ALL, 'mopidy')
|
||||||
|
|
||||||
def on_buffering(self, percent, structure=None):
|
def on_buffering(self, percent, structure=None):
|
||||||
|
if self._audio._target_state < Gst.State.PAUSED:
|
||||||
|
gst_logger.debug('Skip buffering during track change.')
|
||||||
|
return
|
||||||
|
|
||||||
if structure is not None and structure.has_field('buffering-mode'):
|
if structure is not None and structure.has_field('buffering-mode'):
|
||||||
buffering_mode = structure.get_enum(
|
buffering_mode = structure.get_enum(
|
||||||
'buffering-mode', Gst.BufferingMode)
|
'buffering-mode', Gst.BufferingMode)
|
||||||
@ -705,7 +709,6 @@ class Audio(pykka.ThreadingActor):
|
|||||||
|
|
||||||
:rtype: :class:`True` if successfull, else :class:`False`
|
:rtype: :class:`True` if successfull, else :class:`False`
|
||||||
"""
|
"""
|
||||||
self._buffering = False
|
|
||||||
return self._set_state(Gst.State.NULL)
|
return self._set_state(Gst.State.NULL)
|
||||||
|
|
||||||
def wait_for_state_change(self):
|
def wait_for_state_change(self):
|
||||||
@ -748,6 +751,9 @@ class Audio(pykka.ThreadingActor):
|
|||||||
:type state: :class:`Gst.State`
|
:type state: :class:`Gst.State`
|
||||||
:rtype: :class:`True` if successfull, else :class:`False`
|
:rtype: :class:`True` if successfull, else :class:`False`
|
||||||
"""
|
"""
|
||||||
|
if state < Gst.State.PAUSED:
|
||||||
|
self._buffering = False
|
||||||
|
|
||||||
self._target_state = state
|
self._target_state = state
|
||||||
result = self._playbin.set_state(state)
|
result = self._playbin.set_state(state)
|
||||||
gst_logger.debug(
|
gst_logger.debug(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user