Only report a client ip as metadata when a play session has started.

This commit is contained in:
Mike Brady
2018-03-20 21:24:47 +00:00
parent d7a78841de
commit 0993f3f15b
2 changed files with 14 additions and 1 deletions
+11
View File
@@ -295,6 +295,17 @@ void set_dacp_server_information(rtsp_conn_info *conn) { // tell the DACP conver
metadata_hub_modify_prolog();
int ch = metadata_store.dacp_server_active != dacp_server.scan_enable;
metadata_store.dacp_server_active = dacp_server.scan_enable;
if ((metadata_store.client_ip == NULL) ||
(strncmp(metadata_store.client_ip, conn->client_ip_string, INET6_ADDRSTRLEN) != 0)) {
if (metadata_store.client_ip)
free(metadata_store.client_ip);
metadata_store.client_ip = strndup(conn->client_ip_string, INET6_ADDRSTRLEN);
debug(1, "MH Client IP set to: \"%s\"", metadata_store.client_ip);
metadata_store.client_ip_changed = 1;
metadata_store.changed = 1;
ch = 1;
}
metadata_hub_modify_epilog(ch);
pthread_cond_signal(&dacp_server_information_cv);
+3 -1
View File
@@ -429,6 +429,7 @@ void metadata_hub_process_metadata(uint32_t type, uint32_t code, char *data, uin
metadata_hub_modify_epilog(1);
}
break;
/*
case 'clip':
if ((metadata_store.client_ip == NULL) ||
(strncmp(metadata_store.client_ip, data, length) != 0)) {
@@ -436,12 +437,13 @@ void metadata_hub_process_metadata(uint32_t type, uint32_t code, char *data, uin
if (metadata_store.client_ip)
free(metadata_store.client_ip);
metadata_store.client_ip = strndup(data, length);
// debug(1, "MH Client IP set to: \"%s\"", metadata_store.client_ip);
debug(1, "MH Client IP set to: \"%s\"", metadata_store.client_ip);
metadata_store.client_ip_changed = 1;
metadata_store.changed = 1;
metadata_hub_modify_epilog(1);
}
break;
*/
case 'svip':
if ((metadata_store.server_ip == NULL) ||
(strncmp(metadata_store.server_ip, data, length) != 0)) {