fix: negative duration
This commit is contained in:
parent
ceca1904d7
commit
4f40efa99c
@ -106,7 +106,9 @@ impl FileStore {
|
|||||||
v_stream.map(|v| v.width as u32),
|
v_stream.map(|v| v.width as u32),
|
||||||
v_stream.map(|v| v.height as u32),
|
v_stream.map(|v| v.height as u32),
|
||||||
mime,
|
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),
|
probe.as_ref().map(|p| p.bitrate as u32),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,11 @@ impl WebpProcessor {
|
|||||||
mime_type: "image/webp".to_string(),
|
mime_type: "image/webp".to_string(),
|
||||||
width: image_stream.width,
|
width: image_stream.width,
|
||||||
height: image_stream.height,
|
height: image_stream.height,
|
||||||
duration: probe.duration,
|
duration: if probe.duration < 0. {
|
||||||
|
0.
|
||||||
|
} else {
|
||||||
|
probe.duration
|
||||||
|
},
|
||||||
bitrate: probe.bitrate as u32,
|
bitrate: probe.bitrate as u32,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user