From e1108466f6078101005a12b52d2c91539d908549 Mon Sep 17 00:00:00 2001 From: Filipi Fuchter Date: Mon, 14 Apr 2025 10:36:25 -0300 Subject: [PATCH] Fixed an issue in `SmallWebRTCTransport` where an error was thrown if the client did not create a video transceiver. --- CHANGELOG.md | 8 ++++++++ src/pipecat/transports/network/webrtc_connection.py | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49baf8629..205339086 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to **Pipecat** will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Fixed + +- Fixed an issue in `SmallWebRTCTransport` where an error was thrown if the + client did not create a video transceiver. + ## [0.0.63] - 2025-04-11 ### Added diff --git a/src/pipecat/transports/network/webrtc_connection.py b/src/pipecat/transports/network/webrtc_connection.py index d4e3224ed..81ece3af7 100644 --- a/src/pipecat/transports/network/webrtc_connection.py +++ b/src/pipecat/transports/network/webrtc_connection.py @@ -219,7 +219,9 @@ class SmallWebRTCConnection(BaseObject): await self._call_event_handler("connected") # We are renegotiating here, because likely we have loose the first video frames # and aiortc does not handle that pretty well. - await self.video_input_track().discard_old_frames() + video_input_track = self.video_input_track() + if video_input_track: + await self.video_input_track().discard_old_frames() self.ask_to_renegotiate() async def renegotiate(self, sdp: str, type: str, restart_pc: bool = False):