Browse Source

Be more nice

Martijn Braam 3 years ago
parent
commit
a0b1f4377f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      postprocess.c

+ 6 - 0
postprocess.c

@@ -6,6 +6,7 @@
 #include <jpeglib.h>
 #include <libexif/exif-data.h>
 #include <time.h>
+#include <unistd.h>
 #include "postprocess.h"
 #include "stacker.h"
 
@@ -368,6 +369,8 @@ postprocess_internal(char *burst_dir, char *target_dir, int keep)
     char outpath[512];
     char stackpath[512];
 
+    nice(19);
+
     burst_size = scandir(burst_dir, &namelist, filter_dng, alphasort);
     if (burst_size < 0) {
         printf("oop\n");
@@ -441,6 +444,9 @@ postprocess_single(char *in_path, char *out_path, int quality, int verbose)
     clock_t timer;
     stacker_t *stacker = stacker_create(verbose);
 
+    // Give the operating system more cpu time
+    nice(19);
+
     // Parse exif data from original file
     timer = clock();
     imagedata = read_exif(in_path);