aboutsummaryrefslogtreecommitdiff
path: root/flowy/src/main.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-11-18 17:37:57 +0100
committermetamuffin <metamuffin@disroot.org>2023-11-18 17:37:57 +0100
commit754ebf34cbb6280ef77421e1ca54d35d727dc6f7 (patch)
tree00548d19aafdcf34bda914b0c8c15654b720ac7a /flowy/src/main.rs
parentcdb9a3afabe7a239a08c640b19242ff9b1e3b051 (diff)
downloadvideo-codec-experiments-754ebf34cbb6280ef77421e1ca54d35d727dc6f7.tar
video-codec-experiments-754ebf34cbb6280ef77421e1ca54d35d727dc6f7.tar.bz2
video-codec-experiments-754ebf34cbb6280ef77421e1ca54d35d727dc6f7.tar.zst
debug and better search
Diffstat (limited to 'flowy/src/main.rs')
-rw-r--r--flowy/src/main.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/flowy/src/main.rs b/flowy/src/main.rs
index 6620ed8..8529f2c 100644
--- a/flowy/src/main.rs
+++ b/flowy/src/main.rs
@@ -5,7 +5,8 @@ use log::{debug, info};
use motion::{dec::MotionDecoder, enc::MotionEncoder, CommonBuffers, Params};
use pollster::FutureExt;
use std::{
- io::{stdin, stdout, Read, Write},
+ io::{stdin, stdout, ErrorKind, Read, Write},
+ process::exit,
time::Instant,
};
use wgpu::{
@@ -86,9 +87,16 @@ fn main() {
debug: fparams.debug == 2,
preview: fparams.debug > 0,
};
- eprintln!("{params:?} {rp:?}");
+ debug!("{params:?} {rp:?}");
debug!("read");
- stdin().read_exact(&mut buffer).unwrap();
+ match stdin().read_exact(&mut buffer) {
+ Ok(_) => (),
+ Err(e) if e.kind() == ErrorKind::UnexpectedEof => {
+ break;
+ }
+ Err(e) => Err(e).unwrap(),
+ }
+
framework.next_frame_manual();
debug!("upload");
@@ -120,4 +128,6 @@ fn main() {
stdout().write_all(&buffer).unwrap();
i += 1;
}
+ eprintln!("done");
+ exit(0);
}