From 75911469284f2f8d98fee593cb3585fc76e77a5d Mon Sep 17 00:00:00 2001 From: Scott Lamb Date: Fri, 4 Jun 2021 23:10:13 -0700 Subject: [PATCH] fix thinko in video sample chunk code This caused served chunks to be truncated. On seek, nginx sometimes served 502 errors, chrome sometimes returned ERR_CONTENT_LENGTH_MISMATCH, and videos weren't playing properly. --- server/src/mp4.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/mp4.rs b/server/src/mp4.rs index 80021d7..040cac7 100644 --- a/server/src/mp4.rs +++ b/server/src/mp4.rs @@ -1812,7 +1812,7 @@ impl FileInner { format_err_t!(NotFound, "{}: stream not found", s.s.id), ))))) } - Some(d) => d.open_file(s.s.id, (r.start + sr.start)..(r.end + sr.start - r.start)), + Some(d) => d.open_file(s.s.id, (r.start + sr.start)..(r.end + sr.start)), }; Box::new(f.map_ok(Chunk::from).map_err(wrap_error)) }