Bug 377623 - Mpris2 length/position overflow, use doubles instead of int
Summary: Mpris2 length/position overflow, use doubles instead of int
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Media Player (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-14 16:33 UTC by Chris Holland
Modified: 2018-09-05 03:45 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.8.7


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Holland 2017-03-14 16:33:54 UTC
QML's int has a max of 2000000000.

http://doc.qt.io/qt-5/qml-int.html

(2000000000 / 1000000 / 60) = 33.3 minutes is the maximum track we can play before it overflows. Most movies are longer, but some songs (mixes) could be that long too.

QML's  Slider uses real for the maximumValue, and there doesn't seem to be a long datatype,  but I suggest using doubles.

http://doc.qt.io/qt-5/qml-qtquick-controls-slider.html
http://doc.qt.io/qt-5/qtqml-typesystem-basictypes.html
Comment 1 Kai Uwe Broulik 2017-04-17 11:42:50 UTC
Patch: https://phabricator.kde.org/D5481
Comment 2 Kai Uwe Broulik 2017-04-18 21:55:03 UTC
Git commit 550860f6366cc99d3f0ff19f74fd3fc3d1bfc0ad by Kai Uwe Broulik.
Committed on 18/04/2017 at 21:47.
Pushed by broulik into branch 'Plasma/5.8'.

[Media Controller] Use double for length instead of int

Length is in microseconds, so watching a long video (in excess of 33.3 minutes) will break the slider.

CHANGELOG: Media Controller can now properly handle and seek long tracks (> 30 minutes)
FIXED-IN: 5.8.7

M  +1    -1    applets/mediacontroller/contents/ui/ExpandedRepresentation.qml

https://commits.kde.org/plasma-workspace/550860f6366cc99d3f0ff19f74fd3fc3d1bfc0ad
Comment 3 Christoph Feck 2018-09-05 03:45:54 UTC
*** Bug 397591 has been marked as a duplicate of this bug. ***