File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ int save_app_config(void) {
5555 fprintf (file , " web_auth_pass: %s\n" , app_config .web_auth_pass );
5656 fprintf (file , " web_enable_static: %s\n" , app_config .web_enable_static ? "true" : "false" );
5757 fprintf (file , " web_server_thread_stack_size: %d\n" , app_config .web_server_thread_stack_size );
58+ if (!EMPTY (timefmt ) || EQUALS (timefmt , DEF_TIMEFMT ))
59+ fprintf (file , " time_format: %s\n" , timefmt );
5860
5961 for (char i = 0 ; i < MAX_OSD ; i ++ ) {
6062 char imgEmpty = EMPTY (osds [i ].img );
@@ -124,6 +126,9 @@ enum ConfigError parse_app_config(void) {
124126 & app_config .web_server_thread_stack_size );
125127 if (err != CONFIG_OK )
126128 goto RET_ERR ;
129+ parse_param_value (& ini , "system" , "time_format" , timefmt );
130+ if (EMPTY (timefmt ))
131+ strcpy (timefmt , DEF_TIMEFMT );
127132
128133 for (char i = 0 ; i < MAX_OSD ; i ++ ) {
129134 char param [8 ];
Original file line number Diff line number Diff line change 22
33osd osds [MAX_OSD ];
44pthread_t regionPid = 0 ;
5- char timefmt [32 ] = DEF_TIMEFMT ;
5+ char timefmt [64 ] ;
66unsigned int rxb_l , txb_l , cpu_l [6 ];
77
88void region_fill_formatted (char * str ) {
@@ -109,7 +109,11 @@ void region_fill_formatted(char* str) {
109109 ipos ++ ;
110110 char s [64 ];
111111 time_t t = time (NULL );
112- struct tm * tm = gmtime (& t );
112+ struct tm * tm ;
113+ if (str [ipos + 1 ] == 'u' ) {
114+ ipos ++ ;
115+ tm = gmtime (& t );
116+ } else tm = localtime (& t );
113117 strftime (s , 64 , timefmt , tm );
114118 strcat (out , s );
115119 opos += strlen (s );
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ typedef struct {
6868} osd ;
6969
7070extern osd osds [MAX_OSD ];
71- extern char timefmt [32 ];
71+ extern char timefmt [64 ];
7272
7373int start_region_handler ();
7474void stop_region_handler ();
You can’t perform that action at this time.
0 commit comments