This commit is contained in:
Freddy Boulton
2025-03-07 19:27:33 -05:00
committed by GitHub
parent f95c3c78be
commit e26eb4567f
2 changed files with 11 additions and 2 deletions

View File

@@ -588,11 +588,11 @@ class ServerToClientVideo(VideoStreamTrack):
try:
pts, time_base = await self.next_timestamp()
await self.args_set.wait()
current_channel.set(self.channel)
if self.generator is None:
self.generator = cast(
Generator[Any, None, Any], self.event_handler(*self.latest_args)
)
current_channel.set(self.channel)
try:
next_array, outputs = split_output(next(self.generator))
if (
@@ -613,7 +613,11 @@ class ServerToClientVideo(VideoStreamTrack):
except Exception as e:
logger.debug("exception %s", e)
exec = traceback.format_exc()
logger.debug("traceback %s ", exec)
logger.debug("traceback %s %s", e, exec)
if isinstance(e, WebRTCError):
raise e
else:
raise WebRTCError(str(e)) from e
class ServerToClientAudio(AudioStreamTrack):
@@ -705,6 +709,10 @@ class ServerToClientAudio(AudioStreamTrack):
logger.debug("exception %s", e)
exec = traceback.format_exc()
logger.debug("traceback %s", exec)
if isinstance(e, WebRTCError):
raise e
else:
raise WebRTCError(str(e)) from e
def stop(self):
logger.debug("audio-to-client stop callback")

View File

@@ -65,6 +65,7 @@ def _send_log(message: str, type: str) -> None:
)
)
print("current_channel", current_channel.get())
if channel := current_channel.get():
try:
loop = asyncio.get_running_loop()