static guint64
str_to_time (char *time)
{
- if (check_time (time)) {
- return (guint64) (atof (time) * GST_SECOND);
- }
- GST_ERROR ("%s not a valid time", time);
- return 0;
+ gdouble nsecs;
+
+ g_return_val_if_fail (check_time (time), 0);
+
+ nsecs = g_ascii_strtod (time, NULL);
+
+ return nsecs * GST_SECOND;
}
static GESTimeline *
char *arg0 = argv[(i * 3) + 1];
guint64 duration = str_to_time (argv[(i * 3) + 2]);
+ if (duration == 0)
+ duration = GST_CLOCK_TIME_NONE;
+
if (!g_strcmp0 ("+pattern", source)) {
clip = GES_CLIP (ges_test_clip_new_for_nick (arg0));
if (!clip) {
return NULL;
}
+ if (!GST_CLOCK_TIME_IS_VALID (duration))
+ duration =
+ GES_TIMELINE_ELEMENT_DURATION (clip) - (GstClockTime) inpoint;
+
g_object_set (clip,
"in-point", (guint64) inpoint, "duration", (guint64) duration, NULL);