Skip to content

Commit 419e215

Browse files
committed
Parse duration as a float instead of integer. Fixes kstep#27
1 parent febf1b9 commit 419e215

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/status.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,12 @@ impl FromIter for Status {
203203
.ok()
204204
.map(|v| Duration::milliseconds((v * 1000.0) as i64))
205205
}
206-
"duration" => result.duration = Some(Duration::seconds(try!(line.1.parse()))),
206+
"duration" => {
207+
result.duration = line.1
208+
.parse::<f32>()
209+
.ok()
210+
.map(|v| Duration::milliseconds((v * 1000.0) as i64))
211+
}
207212
"bitrate" => result.bitrate = Some(try!(line.1.parse())),
208213
"xfade" => result.crossfade = Some(Duration::seconds(try!(line.1.parse()))),
209214
// "mixrampdb" => 0.0, //get_field!(map, "mixrampdb"),

0 commit comments

Comments
 (0)