X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcommonrender.C;h=9561737946fab04d1edd9e4ab343874d6bd12db9;hp=32358c06fda1c24e825dbadcf8413afe5ef9eaa7;hb=7e5a0760f40ff787cc3d93cb7768a901ebe52809;hpb=4784a8d70bc39f9b7e467f93304d2df3f23fd2df diff --git a/cinelerra-5.1/cinelerra/commonrender.C b/cinelerra-5.1/cinelerra/commonrender.C index 32358c06..95617379 100644 --- a/cinelerra-5.1/cinelerra/commonrender.C +++ b/cinelerra-5.1/cinelerra/commonrender.C @@ -127,7 +127,7 @@ void CommonRender::create_modules() { for(module = 0; module < total_modules; module++) { - modules[module]->create_objects(); + modules[module]->Module::create_objects(); } } } @@ -290,10 +290,6 @@ double CommonRender::fromunits(int64_t position) int CommonRender::advance_position(int64_t current_render_length) { - int64_t loop_end = tounits(renderengine->get_edl()->local_session->loop_end, 1); - int64_t loop_start = tounits(renderengine->get_edl()->local_session->loop_start, 0); - int64_t start_position = tounits(renderengine->command->start_position, 0); - int64_t end_position = tounits(renderengine->command->end_position, 1); int direction = renderengine->command->get_direction(); // advance the playback position @@ -302,24 +298,31 @@ int CommonRender::advance_position(int64_t current_render_length) else current_position += current_render_length; + int64_t start_position, end_position; + int play_loop = renderengine->command->play_loop; + int loop_playback = renderengine->get_edl()->local_session->loop_playback; + if( play_loop || !loop_playback ) { + start_position = tounits(renderengine->command->start_position, 0); + end_position = tounits(renderengine->command->end_position, 1); + } + else { + start_position = tounits(renderengine->get_edl()->local_session->loop_start, 0); + end_position = tounits(renderengine->get_edl()->local_session->loop_end, 1); + play_loop = 1; + } // test loop again - if(renderengine->get_edl()->local_session->loop_playback && - !renderengine->command->infinite) - { - if(direction == PLAY_REVERSE) - { - if(current_position <= loop_start) - current_position = loop_end; + if( play_loop && !renderengine->command->infinite ) { + if( direction == PLAY_REVERSE ) { + if( current_position <= start_position ) + current_position = end_position - (start_position - current_position); } - else - { - if(current_position >= loop_end) - current_position = loop_start + (current_position - loop_end); + else { + if( current_position >= end_position ) + current_position = start_position + (current_position - end_position); } } - else + else { // test end of file again - { if( (direction == PLAY_FORWARD && current_position >= end_position) || (direction == PLAY_REVERSE && current_position <= start_position) ) done = 1;