aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-04 10:27:08 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-04 10:27:08 -0500
commit7597ae2b4b646b8fd32113b75a53f3c7d925432b (patch)
tree2667bcf8f639caa7d3dcf7a0f1a0709f1728c67b
parent5309b3182a30d0555137fbe9fba21ed1d06a91d0 (diff)
downloadteleterm-7597ae2b4b646b8fd32113b75a53f3c7d925432b.tar.gz
teleterm-7597ae2b4b646b8fd32113b75a53f3c7d925432b.zip
fix playback of ttyrecs whose timestamps don't start at 0
-rw-r--r--Cargo.lock4
-rw-r--r--Cargo.toml2
-rw-r--r--src/cmd/play.rs6
3 files changed, 7 insertions, 5 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 9948535..fb4de01 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2011,9 +2011,9 @@ dependencies = [
[[package]]
name = "ttyrec"
-version = "0.1.0"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "034c0e4a24b738a650ea69bcb829388a2e72baa5e7aa1e9aa85fcd03e9f5cac6"
+checksum = "24e28759b4efb0e2b5238e1faa979633f80b534659b8559ad8e2e43b8f982c05"
dependencies = [
"futures",
"snafu",
diff --git a/Cargo.toml b/Cargo.toml
index 9941011..bb1b081 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -37,7 +37,7 @@ tokio-pty-process-stream = "0.2"
tokio-signal = "0.2"
tokio-terminal-resize = "0.1"
tokio-tls = "0.2"
-ttyrec = "0.1"
+ttyrec = "0.2"
twoway = "0.2"
url = "2"
users = "0.9"
diff --git a/src/cmd/play.rs b/src/cmd/play.rs
index 28d6985..6efcc74 100644
--- a/src/cmd/play.rs
+++ b/src/cmd/play.rs
@@ -120,8 +120,10 @@ impl PlaySession {
.poll_read()
.context(crate::error::ReadTtyrec))
{
- self.to_write
- .insert_at(frame.data, self.base_time + frame.time);
+ self.to_write.insert_at(
+ frame.data,
+ self.base_time + frame.time - reader.offset().unwrap(),
+ );
} else {
self.file = FileState::Eof;
}