timer: remove MP_START_TIME

instead require mp_raw_time_ns() to not return 0, which all current
implementation already should follow.
This commit is contained in:
NRK
2023-10-27 01:24:41 +06:00
committed by Dudemanguy
parent 2f91e1441e
commit 8bbcc87fee
4 changed files with 8 additions and 15 deletions

View File

@@ -316,7 +316,7 @@ static void print_terminal_line(struct mp_log *log, int lev,
set_msg_color(stream, lev);
if (root->show_time)
fprintf(stream, "[%10.6f] ", (mp_time_ns() - MP_START_TIME) / 1e9);
fprintf(stream, "[%10.6f] ", mp_time_sec());
const char *prefix = log->prefix;
if ((lev >= MSGL_V) || root->verbose || root->module)
@@ -551,7 +551,7 @@ static void *log_file_thread(void *p)
if (e) {
pthread_mutex_unlock(&root->log_file_lock);
fprintf(root->log_file, "[%8.3f][%c][%s] %s",
(mp_time_ns() - MP_START_TIME) / 1e9,
mp_time_sec(),
mp_log_levels[e->level][0], e->prefix, e->text);
fflush(root->log_file);
pthread_mutex_lock(&root->log_file_lock);