From a244d424e218b0c6a484312703b16dcc1a571221 Mon Sep 17 00:00:00 2001 From: Lorenzo Miniero Date: Wed, 28 Feb 2024 15:27:13 +0100 Subject: [PATCH] Added missing Streaming started event to event handlers (fixes #3335) --- src/plugins/janus_streaming.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/janus_streaming.c b/src/plugins/janus_streaming.c index 0e5cd1635b..23213f7972 100644 --- a/src/plugins/janus_streaming.c +++ b/src/plugins/janus_streaming.c @@ -5612,6 +5612,15 @@ void janus_streaming_setup_media(janus_plugin_session *handle) { int ret = gateway->push_event(handle, &janus_streaming_plugin, NULL, event, NULL); JANUS_LOG(LOG_VERB, " >> Pushing event: %d (%s)\n", ret, janus_get_api_error(ret)); json_decref(event); + /* Also notify event handlers */ + if(notify_events && gateway->events_is_enabled()) { + json_t *info = json_object(); + json_object_set_new(info, "status", json_string("started")); + if(session->mountpoint != NULL) + json_object_set_new(info, "id", string_ids ? + json_string(session->mountpoint->id_str) :json_integer(session->mountpoint->id)); + gateway->notify_event(&janus_streaming_plugin, session->handle, info); + } janus_refcount_decrease(&session->ref); } @@ -6629,7 +6638,7 @@ static void *janus_streaming_handler(void *data) { /* Also notify event handlers */ if(notify_events && gateway->events_is_enabled()) { json_t *info = json_object(); - json_object_set_new(info, "status", json_string("starting")); + json_object_set_new(info, "status", json_string(g_atomic_int_get(&session->started) ? "started" : "starting")); if(session->mountpoint != NULL) json_object_set_new(info, "id", string_ids ? json_string(session->mountpoint->id_str) :json_integer(session->mountpoint->id));