From ef1f5954e6fb0f534e9cbb2b5c51072896abab52 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 31 Jan 2013 21:37:06 +0100 Subject: Put print_time into util.c --- src/advtime.c | 14 -------------- src/util.c | 14 ++++++++++++++ src/util.h | 5 +++++ 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/advtime.c b/src/advtime.c index b68b73a..1b0fa3d 100644 --- a/src/advtime.c +++ b/src/advtime.c @@ -17,20 +17,6 @@ pswap(void **p1, void **p2) *p2 = tmp; } -/* print time in format: "hh:mm:ss.xxx" */ -static void -print_time(int64_t msec) { - - int hh = msec / 1000 / 60 / 60; - msec -= hh * 1000 * 60 * 60; - int mm = msec / 1000 / 60; - msec -= mm * 1000 * 60; - int ss = msec / 1000; - msec -= ss * 1000; - - printf("%02d:%02d:%02d.%03jd", hh, mm, ss, msec); -} - static void start_new_szene(int64_t prev_szene_end, int64_t start) { diff --git a/src/util.c b/src/util.c index d9c8f35..8b73466 100644 --- a/src/util.c +++ b/src/util.c @@ -39,3 +39,17 @@ frame_mix(struct video_frame *frame_a, struct video_frame *frame_b) row_b += frame_b->stride; } } + +/* print time in format: "hh:mm:ss.xxx" */ +void +print_time(int64_t msec) { + + int hh = msec / 1000 / 60 / 60; + msec -= hh * 1000 * 60 * 60; + int mm = msec / 1000 / 60; + msec -= mm * 1000 * 60; + int ss = msec / 1000; + msec -= ss * 1000; + + printf("%02d:%02d:%02d.%03jd", hh, mm, ss, msec); +} diff --git a/src/util.h b/src/util.h index bcc2828..649e9ee 100644 --- a/src/util.h +++ b/src/util.h @@ -1,6 +1,8 @@ #ifndef _UTIL_H_ #define _UTIL_H_ +#include + int pgm_save(unsigned char *buf, int wrap, int xsize, int ysize, char *filename); @@ -8,4 +10,7 @@ pgm_save(unsigned char *buf, int wrap, int xsize, int ysize, char *filename); void frame_mix(struct video_frame *frame_a, struct video_frame *frame_b); +void +print_time(int64_t msec); + #endif /* _UTIL_H_ */ -- cgit