Credit Andrew - updating patches for FFmpeg 7.0 as needed since 6.1, now at 7.0,...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / vrender.C
index 43893b2770106845d2fbe6533eadb657bc1e3d81..03b1421da7a69e072b294fb59c6f4a9c40c99c8b 100644 (file)
@@ -70,6 +70,11 @@ VRender::VRender(RenderEngine *renderengine)
        asynchronous = 0;     // render 1 frame at a time
        framerate_counter = 0;
        video_out = 0;
+       track_w = track_h = 0;
+       output_w = output_h = 0;
+       first_frame = 0;
+       output_offset = 0;
+       source_length = 0;
        render_strategy = -1;
 }
 
@@ -133,7 +138,8 @@ int VRender::process_buffer(int64_t input_position,
        int use_vconsole = 1;
        int use_brender = 0;
        int result = 0;
-       int use_cache = renderengine->command->single_frame();
+       int use_cache = renderengine->command->single_frame() ? 1 :
+               renderengine->command->get_direction() == PLAY_REVERSE ? -1 : 0;
 //     int use_asynchronous = 
 //             renderengine->command->realtime && 
 //             renderengine->get_edl()->session->video_every_frame &&
@@ -288,7 +294,7 @@ int VRender::get_colormodel(VEdit *playable_edit, int use_vconsole, int use_bren
 
 void VRender::run()
 {
-       int reconfigure;
+       int reconfigure = 1;
        const int debug = 0;
 
 // Want to know how many samples rendering each frame takes.
@@ -322,13 +328,13 @@ void VRender::run()
 // Want the condition before, since only 1 frame is rendered
 // and the number of frames skipped after this frame varies.
                current_input_length = 1;
-
-               reconfigure = vconsole->test_reconfigure(current_position,
-                       current_input_length);
-
-
+               if( !reconfigure ) reconfigure =
+                       vconsole->test_reconfigure(current_position, current_input_length);
                if(debug) printf("VRender::run %d\n", __LINE__);
-               if(reconfigure) restart_playback();
+               if( reconfigure ) {
+                       restart_playback();
+                       reconfigure = 0;
+               }
 
                if(debug) printf("VRender::run %d\n", __LINE__);
                process_buffer(current_position, use_opengl);