Merge pull request #3338 from omChauhanDev/fix/smallwebrtc-mute-timeout-spam

fix(smallwebrtc): suppress timeout warnings when tracks are disabled
This commit is contained in:
Filipi da Silva Fuchter
2026-01-06 09:07:52 -05:00
committed by GitHub
2 changed files with 11 additions and 2 deletions

View File

@@ -0,0 +1 @@
- Updated `read_audio_frame` & `read_video_frame` methods in `SmallWebRTCClient` to check if the track is enabled before logging a warning.

View File

@@ -304,7 +304,11 @@ class SmallWebRTCClient:
try:
frame = await asyncio.wait_for(video_track.recv(), timeout=2.0)
except asyncio.TimeoutError:
if self._webrtc_connection.is_connected():
if (
self._webrtc_connection.is_connected()
and video_track
and video_track.is_enabled()
):
logger.warning("Timeout: No video frame received within the specified time.")
# self._webrtc_connection.ask_to_renegotiate()
frame = None
@@ -354,7 +358,11 @@ class SmallWebRTCClient:
try:
frame = await asyncio.wait_for(self._audio_input_track.recv(), timeout=2.0)
except asyncio.TimeoutError:
if self._webrtc_connection.is_connected():
if (
self._webrtc_connection.is_connected()
and self._audio_input_track
and self._audio_input_track.is_enabled()
):
logger.warning("Timeout: No audio frame received within the specified time.")
frame = None
except MediaStreamError: