From def01494db8964948a18e7e0432fc62a62e653a7 Mon Sep 17 00:00:00 2001 From: Henrik Friedrichsen Date: Sun, 10 Jan 2021 01:52:56 +0100 Subject: [PATCH] fix: convert duration to i64 to avoid overflow This can happen with longer playables, e.g. podcast episodes. --- src/mpris.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mpris.rs b/src/mpris.rs index fac78be..9af298f 100644 --- a/src/mpris.rs +++ b/src/mpris.rs @@ -53,9 +53,9 @@ fn get_metadata(playable: Option) -> Metadata { ); hm.insert( "mpris:length".to_string(), - Variant(Box::new(i64::from( - playable.map(|t| t.duration() * 1_000).unwrap_or(0), - ))), + Variant(Box::new( + playable.map(|t| t.duration() as i64 * 1_000).unwrap_or(0), + )), ); hm.insert( "mpris:artUrl".to_string(),