From: Mark Wooding Date: Thu, 24 Feb 2022 17:01:26 +0000 (+0000) Subject: dvd-sector-copy.c (report_progress): Show a throbber to help gauge speed. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/dvdrip/commitdiff_plain/a090d4b375305441fff8d6db728b6277a147cfc7 dvd-sector-copy.c (report_progress): Show a throbber to help gauge speed. --- diff --git a/dvd-sector-copy.c b/dvd-sector-copy.c index 3a09336..90efce2 100644 --- a/dvd-sector-copy.c +++ b/dvd-sector-copy.c @@ -356,6 +356,9 @@ static struct timeval last_time; static double wsum, wcount; static struct file *file; +static const char throbber[] = "|<-<|>->"; +static unsigned throbix = 0; + static void report_progress(secaddr pos) { char etastr[32]; @@ -395,8 +398,9 @@ static void report_progress(secaddr pos) if (flags&F_ALLPROGRESS) percent = pos*100.0/limit; else percent = ndone*100.0/nsectors; print_progress - ("copied %.1f%% (%"PRIuSEC" of %"PRIuSEC"; %.1f %sB/s, ETA %s)", - percent, pos, limit, rate, unit, etastr); + ("%c copied %.1f%% (%"PRIuSEC" of %"PRIuSEC"; %.1f %sB/s, ETA %s)", + throbber[throbix], percent, pos, limit, rate, unit, etastr); + throbix++; if (!throbber[throbix]) throbix = 0; if (file && id_kind(file->id) == VOB) { append_progress(" -- %s %d %.1f%%", id_part(file->id) ? "title" : "menu",