X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Famodule.C;h=5de58f4e3a49d21e45ea620fe0fed9e84204cf40;hb=0678b17975f50a831fb8a1cda6baaa961e3b6de7;hp=9e2c59b6840a0ea98559c95813ec9818ff78fc16;hpb=83c58d6d78f6bf0d1d1fd4cfba8654906fe6ec29;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/amodule.C b/cinelerra-5.1/cinelerra/amodule.C index 9e2c59b6..5de58f4e 100644 --- a/cinelerra-5.1/cinelerra/amodule.C +++ b/cinelerra-5.1/cinelerra/amodule.C @@ -49,6 +49,7 @@ #include "theme.h" #include "transition.h" #include "transportque.h" +#include "tracks.h" #include @@ -280,13 +281,12 @@ int AModule::import_samples(AEdit *edit, edit_sample_rate = nested_edl->session->sample_rate; int command = direction == PLAY_REVERSE ? NORMAL_REWIND : NORMAL_FWD; - if( !nested_command ) { + if( !nested_command ) nested_command = new TransportCommand; - nested_command->command = command; - nested_command->get_edl()->copy_all(nested_edl); - nested_command->change_type = CHANGE_ALL; - nested_command->realtime = renderengine->command->realtime; - } + nested_command->command = command; + nested_command->get_edl()->copy_all(nested_edl); + nested_command->change_type = CHANGE_ALL; + nested_command->realtime = renderengine->command->realtime; if( !nested_renderengine ) { nested_renderengine = new RenderEngine(0, get_preferences(), 0, 1); nested_renderengine->set_acache(get_cache()); @@ -295,6 +295,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 +501,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)