Skip to content

Commit

Permalink
Temporarily disable steady ticks on progress bars
Browse files Browse the repository at this point in the history
This fixes an issue where the fps and eta would not update
until the very end of the encode.

See also console-rs/indicatif#493
  • Loading branch information
shssoichiro committed Nov 14, 2022
1 parent 03b8391 commit dc2dbb7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions av1an-core/src/progress_bar.rs
@@ -1,5 +1,4 @@
use std::fmt::Write;
use std::time::Duration;

use indicatif::{
HumanBytes, MultiProgress, ProgressBar, ProgressDrawTarget, ProgressState, ProgressStyle,
Expand Down Expand Up @@ -83,7 +82,7 @@ pub fn init_progress_bar(len: u64) {
PROGRESS_BAR.get_or_init(|| ProgressBar::new(len).with_style(spinner_style()))
};
pb.set_draw_target(ProgressDrawTarget::stderr_with_hz(60));
pb.enable_steady_tick(Duration::from_millis(100));
// pb.enable_steady_tick(Duration::from_millis(100));
pb.reset();
pb.reset_eta();
pb.reset_elapsed();
Expand Down Expand Up @@ -187,7 +186,7 @@ pub fn init_multi_progress_bar(len: u64, workers: usize, total_chunks: usize) {

let pb = ProgressBar::hidden();
pb.set_style(pretty_progress_style());
pb.enable_steady_tick(Duration::from_millis(100));
// pb.enable_steady_tick(Duration::from_millis(100));
pb.reset_elapsed();
pb.reset_eta();
pb.set_position(0);
Expand Down

0 comments on commit dc2dbb7

Please sign in to comment.