diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-01-31 21:37:06 +0100 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2013-01-31 21:37:06 +0100 |
commit | ef1f5954e6fb0f534e9cbb2b5c51072896abab52 (patch) | |
tree | 9e0ed28a10cbe27e69ddb25eca62ad06e4b43054 | |
parent | 1825e27d0f9627faeb6ad59c50d6c64c7d3003f3 (diff) | |
download | advtime-ef1f5954e6fb0f534e9cbb2b5c51072896abab52.tar.gz advtime-ef1f5954e6fb0f534e9cbb2b5c51072896abab52.tar.bz2 advtime-ef1f5954e6fb0f534e9cbb2b5c51072896abab52.zip |
Put print_time into util.c
-rw-r--r-- | src/advtime.c | 14 | ||||
-rw-r--r-- | src/util.c | 14 | ||||
-rw-r--r-- | 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) { @@ -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); +} @@ -1,6 +1,8 @@ #ifndef _UTIL_H_ #define _UTIL_H_ +#include <stdint.h> + 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_ */ |