summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-03 21:12:07 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-08-03 21:12:07 +0900
commit663e35a645c141eddacdb7709d9391c46ea6c05e (patch)
tree51ce32ef558d74ab913726a90b3a31c0a78bbe30
parentc1afb4ae8634d2eb3f9bde58fc8af2d800e52ede (diff)
downloadevas_generic_loaders-663e35a645c141eddacdb7709d9391c46ea6c05e.tar.gz
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
-rw-r--r--src/bin/gst/main.c7
1 files 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);