summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rotord/src/rotor.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h
index fee29bc..78327f7 100644
--- a/rotord/src/rotor.h
+++ b/rotord/src/rotor.h
@@ -614,7 +614,7 @@ namespace Rotor {
float ph=inputs[0]->get((Time_spec)frame);
int seg=((int)ph);
int wv=seg%attributes["filenames"]->vals.size();
- ph=fmod(ph,seg);
+ ph=seg==0?ph:fmod(ph,seg);
if (clip_loaded!=wv){
if (load(media_path+attributes["filenames"]->vals[wv] )) {
clip_loaded=wv;
@@ -626,6 +626,7 @@ namespace Rotor {
}
}
if (isLoaded){
+ int tests=0;
int wanted=0.0f;
int thisframe=((Time_spec)frame).frame();
float clipframerate=(parameters["framerate"]->value==0.0f?player.get_framerate():parameters["framerate"]->value);
@@ -645,8 +646,10 @@ namespace Rotor {
Time_spec testframe=(Time_spec)frame.lastframe();
while ((int)inputs[0]->get(testframe)==seg&&testframe.frame()>0){
testframe=testframe.lastframe();
+
}
segment_start=testframe.time;
+ segment=seg;
}
wanted=(((Time_spec)frame).time-segment_start)*clipspeed*frame.framerate;
lastframe=thisframe;