Parcourir la source

Fix burst length calculation

Martijn Braam il y a 1 an
Parent
commit
2a7a5d37e6
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      src/io_pipeline.c

+ 1 - 2
src/io_pipeline.c

@@ -62,7 +62,6 @@ update_process_pipeline()
                         state_io.camera, state_io.exposure.control);
         }
 
-        MPControl control;
         float balance_red = 1.0f;
         float balance_blue = 1.0f;
         if (state_io.red.control && state_io.blue.control) {
@@ -128,7 +127,7 @@ capture(MPPipeline *pipeline, const void *data)
                 mp_camera_control_get_int32(state_io.camera, V4L2_CID_GAIN);
         gain_norm = (float)state_io.gain.value / (float)state_io.gain.max;
         state_io.burst_length = (int)fmax(sqrtf(gain_norm) * 10, 2) + 1;
-        state_io.burst_length = MIN(1, state_io.burst_length);
+        state_io.burst_length = MAX(1, state_io.burst_length);
         state_io.captures_remaining = state_io.burst_length;
 
         // Change camera mode for capturing