Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix moutpoint_mutex deadlock when rtsp reconnect fail #2542

Merged
merged 10 commits into from
Apr 8, 2021
7 changes: 6 additions & 1 deletion plugins/janus_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -6473,7 +6473,10 @@ static int janus_streaming_rtsp_connect_to_server(janus_streaming_mountpoint *mp
abase[0] = '\0';
int asport = 0, asport_rtcp = 0;
multiple_fds audio_fds = {-1, -1};


if(g_atomic_int_get(&mp->destroyed)){
return -8;
}
lucylu-star marked this conversation as resolved.
Show resolved Hide resolved
janus_mutex_lock(&mountpoints_mutex);
/* Parse both video and audio first before proceed to setup as curldata will be reused */
int vresult = -1;
Expand Down Expand Up @@ -7629,6 +7632,8 @@ static void *janus_streaming_relay_thread(void *data) {
close(source->video_rtcp_fd);
}
source->video_rtcp_fd = -1;
if(g_atomic_int_get(&mountpoint->destroyed))
break;
/* Now let's try to reconnect */
if(janus_streaming_rtsp_connect_to_server(mountpoint) < 0) {
/* Reconnection failed? Let's try again later */
Expand Down