Skip to content

Commit

Permalink
Use a mutex around janus_streaming_rtsp_connect_to_server to avoid co…
Browse files Browse the repository at this point in the history
…llisions on used ports.
  • Loading branch information
atoppi committed Aug 28, 2019
1 parent 30dcef9 commit ced1c7a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/janus_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -6127,10 +6127,13 @@ static void *janus_streaming_relay_thread(void *data) {
}
source->video_rtcp_fd = -1;
/* Now let's try to reconnect */
janus_mutex_lock(&mountpoints_mutex);
if(janus_streaming_rtsp_connect_to_server(mountpoint) < 0) {
/* Reconnection failed? Let's try again later */
JANUS_LOG(LOG_WARN, "[%s] Reconnection of the RTSP stream failed, trying again in a few seconds...\n", name);
janus_mutex_unlock(&mountpoints_mutex);
} else {
janus_mutex_unlock(&mountpoints_mutex);
/* We're connected, let's send a PLAY */
if(janus_streaming_rtsp_play(source) < 0) {
/* Error trying to play? Let's try again later */
Expand Down

0 comments on commit ced1c7a

Please sign in to comment.