diff --git a/crates/samedec/src/app.rs b/crates/samedec/src/app.rs index bf6bfc1..93bcbdc 100644 --- a/crates/samedec/src/app.rs +++ b/crates/samedec/src/app.rs @@ -114,7 +114,8 @@ impl State { return Some(msg.into()); } - None + // end of file; flush any remaining messages out of the decoder + Some(receiver.flush()?.into()) } } diff --git a/crates/samedec/src/main.rs b/crates/samedec/src/main.rs index 1c5bffd..591e31f 100644 --- a/crates/samedec/src/main.rs +++ b/crates/samedec/src/main.rs @@ -48,16 +48,6 @@ fn samedec() -> Result<(), CliError> { std::iter::from_fn(|| Some(inbuf.read_i16::().ok()?)), ); - // flush all data samples out of the decoder - match rx.flush() { - Some(lastmsg) => { - if !args.quiet { - println!("{}", lastmsg) - } - } - None => {} - } - Ok(()) }