Skip to content

Commit

Permalink
Add missing mountpoint mutex unlock and unref, remove double lock (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
atoppi committed Feb 25, 2022
1 parent f8c522f commit 6f0b707
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/plugins/janus_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -4679,6 +4679,8 @@ static json_t *janus_streaming_process_synchronous_request(janus_streaming_sessi
}
}
janus_mutex_unlock(&source->rec_mutex);
janus_refcount_decrease(&mp->ref);
janus_mutex_unlock(&mountpoints_mutex);
/* Send a success response back */
response = json_object();
json_object_set_new(response, "streaming", json_string("ok"));
Expand Down Expand Up @@ -4782,7 +4784,6 @@ static json_t *janus_streaming_process_synchronous_request(janus_streaming_sessi
janus_mutex_lock(&source->rec_mutex);
if(media) {
/* Iterate on all media to stop */
janus_mutex_lock(&source->rec_mutex);
if(json_array_size(media) > 0) {
size_t i = 0;
for(i=0; i<json_array_size(media); i++) {
Expand Down Expand Up @@ -4810,6 +4811,8 @@ static json_t *janus_streaming_process_synchronous_request(janus_streaming_sessi
}
}
janus_mutex_unlock(&source->rec_mutex);
janus_refcount_decrease(&mp->ref);
janus_mutex_unlock(&mountpoints_mutex);
/* Send a success response back */
response = json_object();
json_object_set_new(response, "streaming", json_string("ok"));
Expand Down

0 comments on commit 6f0b707

Please sign in to comment.