- {
- int eta;
-
- /* Don't change the value of ETA more than approximately once
- per second; doing so would cause flashing without providing
- any value to the user. */
- if (bp->total_length != size
- && bp->last_eta_value != 0
- && dl_total_time - bp->last_eta_time < ETA_REFRESH_INTERVAL)
- eta = bp->last_eta_value;
- else
- {
- /* Calculate ETA using the average download speed to predict
- the future speed. If you want to use a speed averaged
- over a more recent period, replace dl_total_time with
- hist->total_time and bp->count with hist->total_bytes.
- I found that doing that results in a very jerky and
- ultimately unreliable ETA. */
- wgint bytes_remaining = bp->total_length - size;
- double eta_ = dl_total_time * bytes_remaining / bp->count;
- if (eta_ >= INT_MAX - 1)
- goto skip_eta;
- eta = (int) (eta_ + 0.5);
- bp->last_eta_value = eta;
- bp->last_eta_time = dl_total_time;
- }
-
- /* Translation note: "ETA" is English-centric, but this must
- be short, ideally 3 chars. Abbreviate if necessary. */
- sprintf (p, _(" eta %s"), eta_to_human_short (eta, false));
- move_to_end (p);
- }
+ {
+ int eta;
+
+ /* Don't change the value of ETA more than approximately once
+ per second; doing so would cause flashing without providing
+ any value to the user. */
+ if (bp->total_length != size
+ && bp->last_eta_value != 0
+ && dl_total_time - bp->last_eta_time < ETA_REFRESH_INTERVAL)
+ eta = bp->last_eta_value;
+ else
+ {
+ /* Calculate ETA using the average download speed to predict
+ the future speed. If you want to use a speed averaged
+ over a more recent period, replace dl_total_time with
+ hist->total_time and bp->count with hist->total_bytes.
+ I found that doing that results in a very jerky and
+ ultimately unreliable ETA. */
+ wgint bytes_remaining = bp->total_length - size;
+ double eta_ = dl_total_time * bytes_remaining / bp->count;
+ if (eta_ >= INT_MAX - 1)
+ goto skip_eta;
+ eta = (int) (eta_ + 0.5);
+ bp->last_eta_value = eta;
+ bp->last_eta_time = dl_total_time;
+ }
+
+ /* Translation note: "ETA" is English-centric, but this must
+ be short, ideally 3 chars. Abbreviate if necessary. */
+ sprintf (p, _(" eta %s"), eta_to_human_short (eta, false));
+ move_to_end (p);
+ }