summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Klemkow <j.klemkow@wemelug.de>2013-02-01 05:25:02 +0100
committerJan Klemkow <j.klemkow@wemelug.de>2013-02-01 05:25:02 +0100
commite9d5e2fe6eb8b5c087a6df59570324571858c14e (patch)
tree14cc122d1fbf57ce74121071d4dab98467b59872
parentb1d4e30974dea432cae98a6ed149988d1063e1e6 (diff)
downloadadvtime-e9d5e2fe6eb8b5c087a6df59570324571858c14e.tar.gz
advtime-e9d5e2fe6eb8b5c087a6df59570324571858c14e.tar.bz2
advtime-e9d5e2fe6eb8b5c087a6df59570324571858c14e.zip
clean up code.
-rw-r--r--src/overlap.c10
1 files changed, 4 insertions, 6 deletions
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);