Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
lucylu-star committed Apr 8, 2021
1 parent 8df2253 commit ef8075b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions plugins/janus_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -6474,11 +6474,10 @@ static int janus_streaming_rtsp_connect_to_server(janus_streaming_mountpoint *mp
int asport = 0, asport_rtcp = 0;
multiple_fds audio_fds = {-1, -1};

janus_mutex_lock(&mp->mutex);
if(g_atomic_int_get(&mp->destroyed)){
janus_mutex_unlock(&mp->mutex);
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 All @@ -6491,7 +6490,7 @@ static int janus_streaming_rtsp_connect_to_server(janus_streaming_mountpoint *mp
aresult = janus_streaming_rtsp_parse_sdp(curldata->buffer, name, "audio", abase, &apt,
atransport, ahost, artpmap, afmtp, acontrol, &source->audio_iface, &audio_fds);
}
janus_mutex_unlock(&mp->mutex);
janus_mutex_unlock(&mountpoints_mutex);

if(vresult == -1 && aresult == -1) {
/* Both audio and video failed? Give up... */
Expand Down Expand Up @@ -7635,7 +7634,7 @@ static void *janus_streaming_relay_thread(void *data) {
}
source->video_rtcp_fd = -1;
if(g_atomic_int_get(&mountpoint->destroyed))
break;
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 ef8075b

Please sign in to comment.