Only showing the timout warning to receive frame if the client is connected.
This commit is contained in:
@@ -187,9 +187,10 @@ class SmallWebRTCClient:
|
|||||||
try:
|
try:
|
||||||
frame = await asyncio.wait_for(self._video_input_track.recv(), timeout=1.0)
|
frame = await asyncio.wait_for(self._video_input_track.recv(), timeout=1.0)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
|
if self._webrtcConnection.is_connected():
|
||||||
logger.warning("Timeout: No video frame received within the specified time.")
|
logger.warning("Timeout: No video frame received within the specified time.")
|
||||||
frame = None
|
|
||||||
self._webrtcConnection.ask_to_renegotiate()
|
self._webrtcConnection.ask_to_renegotiate()
|
||||||
|
frame = None
|
||||||
|
|
||||||
if frame is None or not isinstance(frame, VideoFrame):
|
if frame is None or not isinstance(frame, VideoFrame):
|
||||||
# If no valid frame, sleep for a bit
|
# If no valid frame, sleep for a bit
|
||||||
@@ -233,6 +234,7 @@ class SmallWebRTCClient:
|
|||||||
try:
|
try:
|
||||||
frame = await asyncio.wait_for(self._audio_input_track.recv(), timeout=1.0)
|
frame = await asyncio.wait_for(self._audio_input_track.recv(), timeout=1.0)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
|
if self._webrtcConnection.is_connected():
|
||||||
logger.warning("Timeout: No audio frame received within the specified time.")
|
logger.warning("Timeout: No audio frame received within the specified time.")
|
||||||
frame = None
|
frame = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user