From 663e35a645c141eddacdb7709d9391c46ea6c05e Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 3 Aug 2014 21:12:07 +0900 Subject: fix gst video loader in generic to have key actually work this never worked - key in gst loader was meant to be position in seconds (well an integer with 1000 units per second). it was just wrong and never worked. works now. :) @fix --- src/bin/gst/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bin/gst/main.c b/src/bin/gst/main.c index 3dffbb2..050b74f 100644 --- a/src/bin/gst/main.c +++ b/src/bin/gst/main.c @@ -119,6 +119,7 @@ _gst_init(const char *filename) gst_element_query_duration (pipeline, format, &duration); if (duration == -1) { + fprintf(stderr, "duration fetch err\n"); D("could not retrieve the duration, set it to 1s\n"); duration = 1 * GST_SECOND; } @@ -219,13 +220,13 @@ main(int argc, char **argv) numonly = 1; for (p = argv[i]; *p; p++) { - if ((!*p < '0') || (*p > 9)) + if ((*p < '0') || (*p > '9')) { numonly = 0; break; } } - if (numonly) pos = (double)(atoll(argv[i])) / 1000.0; + if (numonly) pos = atoll(argv[i]) * 1000000; i++; } else if (!strcmp(argv[i], "-opt-scale-down-by")) @@ -254,6 +255,8 @@ main(int argc, char **argv) return -1; D("_gst_init done\n"); + if ((pos >= 0) && (pos > duration)) return -1; + if (!head_only) { _gst_load_image(size_w, size_h, pos); -- cgit v1.2.1