From 7d0e2081df281f494321b25e7ba4324faff2cc90 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 22 Nov 2019 13:43:59 +0100 Subject: Fix preview ffmpeg returns a float in duration. QVariant::toInt() can't parse it (any more?), so use toFloat() and static_cast it to int. --- helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'helper.cpp') diff --git a/helper.cpp b/helper.cpp index 627aec7..6a6a05c 100644 --- a/helper.cpp +++ b/helper.cpp @@ -261,7 +261,7 @@ namespace Helper { QPixmap preview(const QString &path){ QVariantMap m = ffmpegData(path); - auto secs = m.value("duration").toInt(); + auto secs = static_cast(m.value("duration").toFloat()); auto interval = secs / 4; QImage retval(640 * 2 + 40, 480 * 2 + 40, QImage::Format_ARGB32); retval.fill(Qt::transparent); -- cgit v1.2.3-70-g09d2