Fix issue in unused mod_ffmpeg importer security fixes; read from the ffmpeg output...
[synfig.git] / synfig-core / trunk / src / synfig / valuenode_timeloop.cpp
index 913a4c6..8ed0fad 100644 (file)
@@ -60,8 +60,8 @@ ValueNode_TimeLoop::ValueNode_TimeLoop(const ValueNode::Handle &x):
 {
        set_link("link", x);
        set_link("link_time",  ValueNode_Const::create(Time(0)));
-       set_link("local_time", ValueNode_Const::create(Time(1)));
-       set_link("duration",   ValueNode_Const::create(Time(0)));
+       set_link("local_time", ValueNode_Const::create(Time(0)));
+       set_link("duration",   ValueNode_Const::create(Time(1)));
 }
 
 ValueNode_TimeLoop*
@@ -163,13 +163,14 @@ ValueNode_TimeLoop::operator()(Time t)const
        {
                t -= local_time;
                t -= floor(t / duration) * duration;
-               t = link_time + t;
+               t  = link_time + t;
        }
        else
        {
+               duration = -duration;
                t -= local_time;
                t -= floor(t / duration) * duration;
-               t = link_time + duration - t;
+               t  = link_time - t;
        }
 
        return (*link_)(t);