Skip to content

Commit af56d61

Browse files
committed
feat: only call frame processor handlers if room is set
1 parent 5ecca5d commit af56d61

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

livekit-rtc/livekit/rtc/audio_stream.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,15 +252,16 @@ def _set_room(self, room: Optional["Room"]) -> None:
252252

253253
if self._processor:
254254
room = self._resolve_room()
255-
if room and room._token is not None and room._server_url is not None:
256-
self._processor._on_credentials_updated(token=room._token, url=room._server_url)
257-
258-
participant_identity, publication_sid = self._find_publication() or ("", "")
259-
self._processor._on_stream_info_updated(
260-
room_name=room.name if room is not None else "", # FIXME: default value?
261-
participant_identity=participant_identity,
262-
publication_sid=publication_sid,
263-
)
255+
if room:
256+
if room._token is not None and room._server_url is not None:
257+
self._processor._on_credentials_updated(token=room._token, url=room._server_url)
258+
259+
participant_identity, publication_sid = self._find_publication() or ("", "")
260+
self._processor._on_stream_info_updated(
261+
room_name=room.name,
262+
participant_identity=participant_identity,
263+
publication_sid=publication_sid,
264+
)
264265

265266
def _resolve_room(self) -> Optional["Room"]:
266267
return self._room_ref() if self._room_ref is not None else None

0 commit comments

Comments
 (0)