X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fbrender.C;h=9fc3355afe2848387d03d243240b5b6b757894a2;hb=1b764a9134043e08d4ca6161a6ac58b105cc6b2b;hp=8a3b22b2be50d22ec05a33b6f53d0f00b247e602;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/brender.C b/cinelerra-5.1/cinelerra/brender.C index 8a3b22b2..9fc3355a 100644 --- a/cinelerra-5.1/cinelerra/brender.C +++ b/cinelerra-5.1/cinelerra/brender.C @@ -230,56 +230,36 @@ void BRender::allocate_map(int64_t brender_start, int64_t start, int64_t end) int BRender::set_video_map(int64_t position, int value) { - int update_gui = 0; +//printf("BRender::set_video_map(%jd, %d)\n", position, value); map_lock->lock("BRender::set_video_map"); - if(value == BRender::NOT_SCANNED) { printf(_("BRender::set_video_map called to set NOT_SCANNED\n")); } - -// Preroll - if(position < 0) - { - ; - } - else -// In range - if(position < map_size) - { - map[position] = value; - } - else -// Obsolete EDL - { + if( position < 0) {} // Preroll + else if( position < map_size ) map[position] = value; // In range + else // Obsolete EDL printf(_("BRender::set_video_map %jd: attempt to set beyond end of map %jd.\n"), position, map_size); - } + int update_gui = 0; // Maintain last contiguous here to reduce search time - if(position == last_contiguous && last_contiguous < map_size ) - { - int i; - for(i = position + 1; i < map_size && map[i]; i++) - { - ; - } - last_contiguous = i; + if( position == last_contiguous && last_contiguous < map_size ) { + while( last_contiguous < map_size && map[last_contiguous] ) + ++last_contiguous; + if( last_contiguous >= map_size ) update_gui = 1; mwindow->session->brender_end = (double)last_contiguous / mwindow->edl->session->frame_rate; - if(timer->get_difference() > 1000 || last_contiguous >= map_size) - { - update_gui = 1; - timer->update(); - } } + if( timer->get_difference() > 1000 ) + update_gui = 1; map_lock->unlock(); - if(update_gui) - { + if( update_gui ) { + timer->update(); mwindow->gui->lock_window("BRender::set_video_map"); mwindow->gui->update_timebar(1); mwindow->gui->unlock_window();