Skip to content

Commit

Permalink
fix moutpoint_mutex deadlock when rtsp reconnect fail (#2542)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucylu-star committed Apr 8, 2021
1 parent e674f1a commit 56d1470
Showing 1 changed file with 6 additions and 1 deletion.
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;
}
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

0 comments on commit 56d1470

Please sign in to comment.