diff --git a/dump1090.c b/dump1090.c index a8e96af..32e567b 100644 --- a/dump1090.c +++ b/dump1090.c @@ -558,7 +558,7 @@ void readDataFromFile(void) { // Convert the new data convert_samples(readbuf, &outbuf->data[Modes.trailing_samples], slen, &outbuf->total_power); - if (Modes.interactive) { + if (Modes.throttle) { // Wait until we are allowed to release this buffer to the main thread while (clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &next_buffer_delivery, NULL) == EINTR) ; @@ -670,7 +670,8 @@ void showHelp(void) { "--freq Set frequency (default: 1090 Mhz)\n" "--ifile Read data from file (use '-' for stdin)\n" "--iformat Sample format for --ifile: UC8 (default), SC16, or SC16Q11\n" -"--interactive Interactive mode refreshing data on screen\n" +"--throttle When reading from a file, play back in realtime, not at max speed\n" +"--interactive Interactive mode refreshing data on screen. Implies --throttle\n" "--interactive-rows Max number of rows in interactive mode (default: 15)\n" "--interactive-ttl Remove from list if idle for (default: 60)\n" "--interactive-rtl1090 Display flight table in RTL1090 format\n" @@ -997,7 +998,9 @@ int main(int argc, char **argv) { } else if (!strcmp(argv[j],"--aggressive")) { Modes.nfix_crc = MODES_MAX_BITERRORS; } else if (!strcmp(argv[j],"--interactive")) { - Modes.interactive = 1; + Modes.interactive = Modes.throttle = 1; + } else if (!strcmp(argv[j],"--throttle")) { + Modes.throttle = 1; } else if (!strcmp(argv[j],"--interactive-rows") && more) { Modes.interactive_rows = atoi(argv[++j]); } else if (!strcmp(argv[j],"--interactive-ttl") && more) { diff --git a/dump1090.h b/dump1090.h index 67f0c11..12701f8 100644 --- a/dump1090.h +++ b/dump1090.h @@ -339,6 +339,7 @@ struct { // Internal state char *json_dir; // Path to json base directory, or NULL not to write json. uint64_t json_interval; // Interval between rewriting the json aircraft file, in milliseconds; also the advertised map refresh interval int json_location_accuracy; // Accuracy of location metadata: 0=none, 1=approx, 2=exact + int throttle; // When reading from a file, throttle file playback to realtime? int json_aircraft_history_next; struct {