Skip to content

Commit

Permalink
rtprecv: detach sockets before attach
Browse files Browse the repository at this point in the history
  • Loading branch information
cspiel1 committed Nov 2, 2023
1 parent e9eaeec commit 75fe91c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rtprecv.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,16 +685,16 @@ int rtprecv_start_thread(struct rtp_receiver *rx)
if (re_atomic_rlx(&rx->run))
return 0;

udp_thread_detach(rtp_sock(rx->rtp));
udp_thread_detach(rtcp_sock(rx->rtp));
re_atomic_rlx_set(&rx->run, true);
err = thread_create_name(&rx->thr,
"RX thread",
rtprecv_thread, rx);
if (err) {
re_atomic_rlx_set(&rx->run, false);
}
else {
udp_thread_detach(rtp_sock(rx->rtp));
udp_thread_detach(rtcp_sock(rx->rtp));
udp_thread_attach(rtp_sock(rx->rtp));
udp_thread_attach(rtcp_sock(rx->rtp));
}

return err;
Expand Down

0 comments on commit 75fe91c

Please sign in to comment.