Skip to content

Commit

Permalink
allow changing of the timestamp char code delimeter (#1972)
Browse files Browse the repository at this point in the history
  • Loading branch information
knight-of-ni authored and connortechnology committed Aug 21, 2017
1 parent 431ec3e commit ac5d173
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in
Expand Up @@ -700,6 +700,25 @@ our @options = (
type => $types{boolean},
category => 'config',
},
{
name => 'ZM_TIMESTAMP_CODE_CHAR',
default => '%',
description => 'Character to used to identify timestamp codes',
help => q`
There are a few codes one can use to tell ZoneMinder to insert
data into the timestamp of each image. Traditionally, the
percent (%) character has been used to identify these codes since
the current character codes do not conflict with the strftime
codes, which can also be used in the timestamp. While this works
well for Linux, this does not work well for BSD operating systems.
Changing the default character to something else, such as an
exclamation point (!), resolves the issue. Note this only affects
the timestamp codes built into ZoneMinder. It has no effect on
the family of strftime codes one can use.
`,
type => $types{string},
category => 'config',
},
{
name => 'ZM_CPU_EXTENSIONS',
default => 'yes',
Expand Down
2 changes: 1 addition & 1 deletion src/zm_monitor.cpp
Expand Up @@ -2941,7 +2941,7 @@ void Monitor::TimestampImage( Image *ts_image, const struct timeval *ts_time ) c
const char *s_ptr = label_time_text;
char *d_ptr = label_text;
while ( *s_ptr && ((d_ptr-label_text) < (unsigned int)sizeof(label_text)) ) {
if ( *s_ptr == '%' ) {
if ( *s_ptr == config.timestamp_code_char[0] ) {
bool found_macro = false;
switch ( *(s_ptr+1) ) {
case 'N' :
Expand Down

0 comments on commit ac5d173

Please sign in to comment.