rtsp: fix SIGSEGV

This commit is contained in:
Kamil Trzcinski
2023-03-03 17:41:38 +01:00
parent 9db8ba5fa5
commit 43f2817442
3 changed files with 58 additions and 6 deletions

View File

@ -135,5 +135,12 @@ extern "C" void camera_status_json(http_worker_t *worker, FILE *stream)
message["endpoints"]["stream"] = get_url(stream_lock.buf_list != NULL, "stream", "http", worker->host, http_options.port, "/stream");
message["endpoints"]["snapshot"] = get_url(snapshot_lock.buf_list != NULL, "snapshot", "http", worker->host, http_options.port, "/stream");
if (rtsp_options.running) {
message["endpoints"]["rtsp"]["clients"] = rtsp_options.clients;
message["endpoints"]["rtsp"]["truncated"] = rtsp_options.truncated;
message["endpoints"]["rtsp"]["frames"] = rtsp_options.frames;
message["endpoints"]["rtsp"]["dropped"] = rtsp_options.dropped;
}
http_write_response(stream, "200 OK", "application/json", message.dump().c_str(), 0);
}