Skip to content

Commit

Permalink
Fixed segfault when stopping Streaming recording, and fixed legacy st…
Browse files Browse the repository at this point in the history
…art recording (see #2902)
  • Loading branch information
lminiero committed Feb 25, 2022
1 parent 6f0b707 commit 9df6c1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugins/janus_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -4740,8 +4740,10 @@ static json_t *janus_streaming_process_synchronous_request(janus_streaming_sessi
codec = "av1";
else if(strstr(stream->codecs.rtpmap, "h265") || strstr(stream->codecs.rtpmap, "H265"))
codec = "h265";
file = json_string_value(video);
} else if(stream->type == JANUS_STREAMING_MEDIA_DATA) {
codec = "text";
file = json_string_value(data);
}
janus_recorder *rc = janus_recorder_create(NULL, codec, (char *)file);
if(rc == NULL) {
Expand Down Expand Up @@ -4796,7 +4798,7 @@ static json_t *janus_streaming_process_synchronous_request(janus_streaming_sessi
GList *temp = source->media;
while(temp) {
janus_streaming_rtp_source_stream *stream = (janus_streaming_rtp_source_stream *)temp->data;
if(strcasecmp(stream->mid, mid)) {
if(strcasecmp(stream->mid, mid) || stream->rc == NULL) {
temp = temp->next;
continue;
}
Expand Down Expand Up @@ -4833,7 +4835,7 @@ static json_t *janus_streaming_process_synchronous_request(janus_streaming_sessi
janus_streaming_rtp_source_stream *stream = (janus_streaming_rtp_source_stream *)temp->data;
if((stream->type == JANUS_STREAMING_MEDIA_AUDIO && !json_is_true(audio)) ||
(stream->type == JANUS_STREAMING_MEDIA_VIDEO && !json_is_true(video)) ||
(stream->type == JANUS_STREAMING_MEDIA_DATA && !json_is_true(data))) {
(stream->type == JANUS_STREAMING_MEDIA_DATA && !json_is_true(data)) || stream->rc == NULL) {
temp = temp->next;
continue;
}
Expand Down

0 comments on commit 9df6c1f

Please sign in to comment.