18 new shapewipe transitions from rafa, rework savefile/confirm for nested edl edits
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / amodule.C
index 9e2c59b6840a0ea98559c95813ec9818ff78fc16..c45935e5aff9ae3c04c322d21ac3a36106c9f038 100644 (file)
@@ -49,6 +49,7 @@
 #include "theme.h"
 #include "transition.h"
 #include "transportque.h"
+#include "tracks.h"
 #include <string.h>
 
 
@@ -295,6 +296,8 @@ int AModule::import_samples(AEdit *edit,
                nested_renderengine->command->command = command;
                result = 0;
        }
+       if( edit_sample_rate <= 0 )
+               result = 1;
 
        if( !result ) {
 // speed_buffer is (have_speed ? speed_temp : buffer)
@@ -499,13 +502,9 @@ if(debug) printf("AModule::render %d %jd\n", __LINE__, fragment_len);
 
 // Clamp to end of transition
                        int64_t transition_len = 0;
-
-                       if(transition &&
-                               previous_edit)
-                       {
-                               transition_len = transition->length *
-                                       sample_rate /
-                                       edl_rate;
+                       Plugin *transition = get_edl()->tracks->plugin_exists(transition_id);
+                       if( transition && previous_edit ) {
+                               transition_len = transition->length * sample_rate / edl_rate;
                                if(direction == PLAY_FORWARD &&
                                        start_position < edit_startproject + transition_len &&
                                        start_position + fragment_len > edit_startproject + transition_len)