Skip to content

Commit

Permalink
Only report a client ip as metadata when a play session has started.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebrady committed Mar 20, 2018
1 parent d7a7884 commit 0993f3f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions dacp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion metadata_hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,19 +429,21 @@ 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)) {
metadata_hub_modify_prolog();
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)) {
Expand Down

0 comments on commit 0993f3f

Please sign in to comment.