From d4ec6827ce9e23a840a017d4770701c6aaccf744 Mon Sep 17 00:00:00 2001 From: Nathan Straub Date: Wed, 16 Oct 2024 23:53:31 -0700 Subject: [PATCH] services(livekit) - Stop Sending EndFrame when Participant Disconnects How It Works Now: A participant disconnecting triggers and EndFrame, invoking stop() on the input and output transports and causing the LiveKit room to disconnect. Proposal: Match the daily implementation, and just trigger the callbacks in the LiveKitTransport. Leave it up to the implementor to decide whether to send EndFrames when this happens. --- src/pipecat/transports/services/livekit.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/pipecat/transports/services/livekit.py b/src/pipecat/transports/services/livekit.py index 73a6445a3..af21cd14a 100644 --- a/src/pipecat/transports/services/livekit.py +++ b/src/pipecat/transports/services/livekit.py @@ -556,10 +556,6 @@ class LiveKitTransport(BaseTransport): async def _on_participant_disconnected(self, participant_id: str): await self._call_event_handler("on_participant_disconnected", participant_id) await self._call_event_handler("on_participant_left", participant_id, "disconnected") - if self._input: - await self._input.process_frame(EndFrame(), FrameDirection.DOWNSTREAM) - if self._output: - await self._output.process_frame(EndFrame(), FrameDirection.DOWNSTREAM) async def _on_audio_track_subscribed(self, participant_id: str): await self._call_event_handler("on_audio_track_subscribed", participant_id)