mirror of
https://github.com/v0l/route96.git
synced 2025-06-17 08:38:49 +00:00
fix: negative duration
This commit is contained in:
@ -106,7 +106,9 @@ impl FileStore {
|
||||
v_stream.map(|v| v.width as u32),
|
||||
v_stream.map(|v| v.height as u32),
|
||||
mime,
|
||||
probe.as_ref().map(|p| p.duration),
|
||||
probe
|
||||
.as_ref()
|
||||
.map(|p| if p.duration < 0. { 0.0 } else { p.duration }),
|
||||
probe.as_ref().map(|p| p.bitrate as u32),
|
||||
)
|
||||
}
|
||||
|
@ -66,7 +66,11 @@ impl WebpProcessor {
|
||||
mime_type: "image/webp".to_string(),
|
||||
width: image_stream.width,
|
||||
height: image_stream.height,
|
||||
duration: probe.duration,
|
||||
duration: if probe.duration < 0. {
|
||||
0.
|
||||
} else {
|
||||
probe.duration
|
||||
},
|
||||
bitrate: probe.bitrate as u32,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user