X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpluginset.C;fp=cinelerra-5.1%2Fcinelerra%2Fpluginset.C;h=b0c096e44d8d2bdb23739f1ebc45f88e9ac0bbe2;hp=575f04651ce78c10fc33d24958b618ecb4c65ac4;hb=28225c37859a74d59211f584abd785860eef9c13;hpb=a76213673ecbfe4d860fb20de1b79ebc0d99c004 diff --git a/cinelerra-5.1/cinelerra/pluginset.C b/cinelerra-5.1/cinelerra/pluginset.C index 575f0465..b0c096e4 100644 --- a/cinelerra-5.1/cinelerra/pluginset.C +++ b/cinelerra-5.1/cinelerra/pluginset.C @@ -164,11 +164,20 @@ KeyFrame *PluginSet::nearest_keyframe(int64_t pos, int dir) pos = first->startproject; else if( last && pos > last->startproject+last->length ) pos = last->startproject+last->length; + KeyFrame *keyframe = 0; Plugin *plugin = (Plugin*)editof(pos, dir, 0); - if( !plugin ) return 0; - KeyFrame *keyframe = (KeyFrame *)(dir == PLAY_FORWARD ? - plugin->keyframes->nearest_after(pos) : - plugin->keyframes->nearest_before(pos)); + if( dir == PLAY_FORWARD ) { + for( ; !keyframe && plugin; plugin=(Plugin*)plugin->next ) { + if( plugin->plugin_type == PLUGIN_NONE ) continue; + keyframe = (KeyFrame *)plugin->keyframes->nearest_after(pos); + } + } + else { + for( ; !keyframe && plugin; plugin=(Plugin*)plugin->previous ) { + if( plugin->plugin_type == PLUGIN_NONE ) continue; + keyframe = (KeyFrame *)plugin->keyframes->nearest_before(pos); + } + } return keyframe; }