X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpluginset.C;h=833ab47364430555f99fd8134c5616ecdba0f69b;hb=bd7011a86f60b4ef1abf11e2667373eba3a98c99;hp=575f04651ce78c10fc33d24958b618ecb4c65ac4;hpb=b32cf83f55420546cdab0ee4b30a7a5638f63f33;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/pluginset.C b/cinelerra-5.1/cinelerra/pluginset.C index 575f0465..833ab473 100644 --- a/cinelerra-5.1/cinelerra/pluginset.C +++ b/cinelerra-5.1/cinelerra/pluginset.C @@ -2,6 +2,7 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams + * Copyright (C) 2003-2016 Cinelerra CV contributors * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -164,11 +165,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; }