Skip to content

Commit dc7ac3d

Browse files
committed
Fix the elapsed time counter
The elapsed time duration is created with millisecond precision by multiplying the second float value by 1000. Such value then has to be fed into Duration::milliseconds rather than Duration::seconds to produce a correctly scaled Duration instance.
1 parent 23a6589 commit dc7ac3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl FromIter for Status {
212212
result.elapsed = line.1
213213
.parse::<f32>()
214214
.ok()
215-
.map(|v| Duration::seconds((v * 1000.0) as i64))
215+
.map(|v| Duration::milliseconds((v * 1000.0) as i64))
216216
}
217217
"duration" => result.duration = Some(Duration::seconds(try!(line.1.parse()))),
218218
"bitrate" => result.bitrate = Some(try!(line.1.parse())),

0 commit comments

Comments
 (0)