Repository navigation
[FIX] Use seconds for the --stream timeout in the Rust code - #2426
Open
Deepak-negi11 wants to merge 1 commit into
Open
Deepak-negi11 wants to merge 1 commit into
Deepak-negi11 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repro instructions:
Needs #2415 (on master
--streamcan't be used with a file at all).Sample: Closed Caption EIA.ts
--stream 2 small.scc--stream 3 "Closed Caption EIA.ts"--streamI found this while testing #2415.
Problem
The C code keeps the
--streamtimeout in seconds. The RustOptionskeep it as aTimestamp. Two places mixed up the units:copy_to_rust(common.rs) read the C seconds as milliseconds, so 3 seconds became 3 ms.sleepandchecktimeout(file.rs) compared a time in seconds withstart + live_stream.millis(), so a 2-second timeout became 2000 seconds.So the timeout was either ignored or about 1000 times too long, depending on the input.
Fix
Use seconds in both places.
copy_from_rustalready wrote seconds, so the round trip now matches.Testing
sleepandchecktimeoutwith a timeout that has already passed. Each one fails if its half of the fix is removed.cargo test(428 passed),cargo fmt --check,cargo clippy -- -D warnings.