Skip to content

Commit

Permalink
Quick fix to ZMQ deadlock error (#784)
Browse files Browse the repository at this point in the history
quick fix
  • Loading branch information
ethanweber authored Oct 16, 2022
1 parent d4670de commit 555cec9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nerfstudio/viewer/server/viewer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,11 @@ def __init__(self, config: cfg.ViewerConfig, log_filename: Path):
CONSOLE.rule(characters="=")
CONSOLE.line()
self.vis = Viewer(zmq_port=zmq_port)
self.vis_webrtc_thread = Viewer(zmq_port=zmq_port)
else:
assert self.config.zmq_port is not None
self.vis = Viewer(zmq_port=self.config.zmq_port, ip_address=self.config.ip_address)
self.vis_webrtc_thread = Viewer(zmq_port=self.config.zmq_port, ip_address=self.config.ip_address)

# viewer specific variables
self.prev_camera_matrix = None
Expand Down Expand Up @@ -488,8 +490,10 @@ async def send_webrtc_answer(self, data):
answer = await pc.createAnswer()
await pc.setLocalDescription(answer)

self.vis["webrtc/answer"].write({"sdp": pc.localDescription.sdp, "type": pc.localDescription.type})
self.vis["webrtc/answer"].delete()
self.vis_webrtc_thread["webrtc/answer"].write(
{"sdp": pc.localDescription.sdp, "type": pc.localDescription.type}
)
self.vis_webrtc_thread["webrtc/answer"].delete()

# continually exchange media
while True:
Expand Down

0 comments on commit 555cec9

Please sign in to comment.