From e9d5e2fe6eb8b5c087a6df59570324571858c14e Mon Sep 17 00:00:00 2001 From: Jan Klemkow Date: Fri, 1 Feb 2013 05:25:02 +0100 Subject: clean up code. --- src/overlap.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/overlap.c b/src/overlap.c index 571e5b8..19134c3 100644 --- a/src/overlap.c +++ b/src/overlap.c @@ -88,12 +88,11 @@ main(int argc, char **argv) struct video_decode *first_vd; struct video_decode *second_vd; struct video_frame *cur_frame = NULL, *last_frame = NULL; -// struct video_frame last_frames[5] = {0}; int ret, ch; int diff_flag = 0; int64_t timestamp = 0; - int64_t duration = 60 * 1000; /* duration for searching min_diff */ - /* 60 sec * 1000 msec = 1 min */ + int64_t duration = 60 * 1000; /* duration for searching min_diff */ + /* default 1 min = 60 sec * 1000 msec */ int64_t min_diff_time = 0; /* dts at overlaping frame */ double min_diff, diff = 0.0; @@ -116,9 +115,6 @@ main(int argc, char **argv) if (argc < 2) usage(); -// if (argc == 2 && strtol(argv[1], NULL, 10) > 0) -// timestamp = strtol(argv[1], NULL, 10); - ret = video_decode_init(&first_vd, argv[0], timestamp); if (ret < 0) return -ret; @@ -128,6 +124,8 @@ main(int argc, char **argv) for (int i = 0; video_decode_get_frame(first_vd, &last_frame) > 0; ++i); ret = video_decode_init(&second_vd, argv[1], timestamp); + if (ret < 0) + return -ret; for (int i = 0; video_decode_get_frame(second_vd, &cur_frame) > 0; ++i){ diff = frame_diff(last_frame, cur_frame); -- cgit