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:
1
changelog/3336.changed.md
Normal file
1
changelog/3336.changed.md
Normal 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.
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user