diff options
| -rw-r--r-- | rotord/src/rotor.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h index e44c753..4c71c84 100644 --- a/rotord/src/rotor.h +++ b/rotord/src/rotor.h @@ -629,7 +629,7 @@ namespace Rotor { int thisframe=((Time_spec)frame).frame(); switch (attributes["frame_mode"]->intVal){ case VIDEOTIME_play: - if(thisframe==lastframe+1){ + if(thisframe==lastframe||thisframe==lastframe+1){ if (segment!=wv){ //start of new segment cerr<<"segment "<<wv<<" started: "<<((Time_spec)frame).time<<endl; @@ -639,9 +639,14 @@ namespace Rotor { } else { //find segment start - //while () + Time_spec testframe=(Time_spec)frame.lastframe(); + while ((int)inputs[0]->get(testframe)==wv&&testframe.frame()>0){ + testframe=testframe.lastframe(); + } + segment_start=testframe.time; } - wanted=ph*player.get_number_frames(); + wanted=(((Time_spec)frame).time-segment_start)*player.get_framerate(); + lastframe=thisframe; break; case VIDEOTIME_stretch: wanted=ph*player.get_number_frames(); |
