fred (fwd render enb displ) play pref. info text tweak
[goodguy/history.git] / cinelerra-5.1 / cinelerra / autos.C
index 7ab31dd54ff3696657cae871de179406306eb203..1f169df2d2a10edcccb2b95991905ea2e94eae65 100644 (file)
@@ -287,14 +287,16 @@ Auto* Autos::get_auto_for_editing(double position)
        }
 
        Auto *result = 0;
-       position = edl->align_to_frame(position, 0);
+       get_prev_auto(track->to_units(position, 0), PLAY_FORWARD, result);
+//printf("Autos::get_auto_for_editing %p %p %p\n", default_auto, first, result);
+       if( !result || !EQUIV(track->from_units(result->position), position) ) {
+               if( edl->session->auto_keyframes ) {
+                       position = edl->align_to_frame(position, 0);
+                       result = insert_auto(track->to_units(position, 0));
+               }
+       }
 //printf("Autos::get_auto_for_editing %p %p\n", first, default_auto);
 
-       result = edl->session->auto_keyframes ?
-               insert_auto(track->to_units(position, 0)) :
-               get_prev_auto(track->to_units(position, 0), PLAY_FORWARD, result);
-
-//printf("Autos::get_auto_for_editing %p %p %p\n", default_auto, first, result);
        return result;
 }