Skip to content

Commit

Permalink
Send an 'idle' response when stopping a not-started mountpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Feb 19, 2025
1 parent 8f9d0ed commit 5fa7376
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/plugins/janus_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -7120,6 +7120,14 @@ static void *janus_streaming_handler(void *data) {
janus_mutex_unlock(&sessions_mutex);
if(g_atomic_int_get(&session->stopping) || !g_atomic_int_get(&session->started)) {
/* Been there, done that: ignore */
json_t *event = json_object();
json_object_set_new(event, "streaming", json_string("event"));
result = json_object();
json_object_set_new(result, "status", json_string("idle"));
json_object_set_new(event, "result", result);
int ret = gateway->push_event(msg->handle, &janus_streaming_plugin, msg->transaction, event, NULL);
JANUS_LOG(LOG_VERB, " >> Pushing event: %d (%s)\n", ret, janus_get_api_error(ret));
json_decref(event);
janus_streaming_message_free(msg);
continue;
}
Expand Down

0 comments on commit 5fa7376

Please sign in to comment.