From a3f6f710a929cdc9165e7aa98e5a55ad3f65f450 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 9 Jan 2021 15:40:00 +0100 Subject: [PATCH] tutorials/basic-tutorial-13: Add "\r" at each println to fix the raw terminal display --- tutorials/src/bin/basic-tutorial-13.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tutorials/src/bin/basic-tutorial-13.rs b/tutorials/src/bin/basic-tutorial-13.rs index 3e47ae88a..8138047dd 100644 --- a/tutorials/src/bin/basic-tutorial-13.rs +++ b/tutorials/src/bin/basic-tutorial-13.rs @@ -29,7 +29,7 @@ fn send_seek_event(pipeline: &Element, rate: f64) -> bool { let position = match pipeline.query_position::() { Some(pos) => pos, None => { - eprintln!("Unable to retrieve current position..."); + eprintln!("Unable to retrieve current position...\r"); return false; } }; @@ -61,11 +61,11 @@ fn send_seek_event(pipeline: &Element, rate: f64) -> bool { .unwrap() .get::() { - println!("Current rate: {}", rate); + println!("Current rate: {}\r", rate); // Send the event video_sink.send_event(seek_event) } else { - eprintln!("Failed to update rate..."); + eprintln!("Failed to update rate...\r"); false } } @@ -157,7 +157,7 @@ USAGE: Choose one of the following options, then press enter: "PLAYING" }; playing = !playing; - println!("Setting state to {}", status); + println!("Setting state to {}\r", status); } Command::DataRateUp => { if send_seek_event(&pipeline, rate * 2.) { @@ -183,7 +183,7 @@ USAGE: Choose one of the following options, then press enter: // Send the event let step = Step::new(gst::format::Buffers(Some(1)), rate.abs(), true, false); video_sink.send_event(step); - println!("Stepping one frame"); + println!("Stepping one frame\r"); } } Command::Quit => {