Skip to content

Commit

Permalink
fix:player_proxy
Browse files Browse the repository at this point in the history
noticed in end2end tests from OpenVoiceOS/ovos-core#621
  • Loading branch information
JarbasAl committed Dec 6, 2024
1 parent ce8893b commit 75a854a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ocp_pipeline/opm.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ def handle_m(m):
LOG.warning(f"Player synchronization timed out after {timeout} seconds")

return player

def get_player(self, message: Optional[Message] = None, timeout=1) -> OCPPlayerProxy:
"""get a PlayerProxy object, containing info such as player state and the available stream extractors from OCP
this is tracked per Session, if needed requests the info from the client"""
Expand All @@ -793,6 +794,7 @@ def get_player(self, message: Optional[Message] = None, timeout=1) -> OCPPlayerP
player = OCPPlayerProxy(available_extractors=available_extractors(),
ocp_available=False,
session_id=sess.session_id)
self.update_player_proxy(player)
else:
player = self.ocp_sessions[sess.session_id]
if not player.ocp_available and not self.config.get("legacy"):
Expand Down Expand Up @@ -1026,7 +1028,6 @@ def legacy_play(self, results: NormalizedResultsList, phrase="",
else:
self.legacy_api.queue(real_uri, source_message=message)


def _handle_legacy_audio_stop(self, message: Message):
player = self.get_player(message)
if not player.ocp_available:
Expand Down

0 comments on commit 75a854a

Please sign in to comment.