Skip to content

Commit

Permalink
make async for future flexibility
Browse files Browse the repository at this point in the history
  • Loading branch information
typester committed Dec 28, 2024
1 parent c69807d commit 221f1de
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/video-stream/audio_wave.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ async def main(room: rtc.Room, room_name: str):
finally:
audio_task.cancel()
await av_sync.aclose()
audio_source.close()
video_source.close()
await audio_source.aclose()
await video_source.aclose()


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions examples/video-stream/video_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ async def _push_frames(
finally:
await streamer.aclose()
await av_sync.aclose()
audio_source.close()
video_source.close()
await audio_source.aclose()
await video_source.aclose()


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion livekit-rtc/livekit/rtc/audio_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def _release_waiter(self) -> None:
self._q_size = 0.0
self._join_fut = None

def close(self) -> None:
async def aclose(self) -> None:
"""Close the audio source
This method cleans up resources associated with the audio source.
Expand Down
2 changes: 1 addition & 1 deletion livekit-rtc/livekit/rtc/video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ def capture_frame(
req.capture_video_frame.timestamp_us = timestamp_us
FfiClient.instance.request(req)

def close(self) -> None:
async def aclose(self) -> None:
self._ffi_handle.dispose()

0 comments on commit 221f1de

Please sign in to comment.