Opened 17 years ago
Closed 17 years ago
Last modified 17 years ago
#699 closed patch (fixed)
AutoExpire::FillDBOrdered uses ints for filesizes
Reported by: | Robert Tsai <rtsai1111> | Owned by: | cpinkham |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
Change [7944] casts a string to an "int" for filesize, which is bad for files > 2GB. The code should use QString::toLongLong() instead of QString::toInt()
This manifests itself as negative numbers being output by "mythbackend --printexpire".
Attachments (2)
Change History (7)
Changed 17 years ago by
Attachment: | mythtv.printexpire.diff added |
---|
comment:1 Changed 17 years ago by
comment:2 Changed 17 years ago by
Can you make and test a patch that in MySQL does the divide by 1024 and then multiply the toInt() by 1024 and see if you can work around it that way? If that works, check programinfo.cpp to see if another change is necessary there when/if we load the filesize.
comment:3 Changed 17 years ago by
Dividing by 1024 in the SQL query (and re-multiplying the result by 1024) works, but I don't like it. The code in programinfo.cpp does something different:
filesize = stringToLongLong(query.value(xx).toString());
So I'll do that.
QString::stringToLongLong appears to be new to qt-3.2; I assume its use in programinfo.cpp means it's OK? The QT version prerequisites and/or support requirements are not in the mythtv.org documentation for compiling source code ...
Changed 17 years ago by
Attachment: | mythtv.printexpire.2.diff added |
---|
Use stringToLongLong instead of toLongLong
comment:4 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [8017]) Close #699 by applying Robert Tsai's patch. AutoExpire? wasn't properly handling filesizes over ~2GB because of overflow using toInt() when the filesize is really a long long.
comment:5 Changed 17 years ago by
stringToLongLong() is actually a Myth function in libs/libmyth/util.cpp. I should have remembered that from when we put the filesize in the DB.
toLongLong doesn't exist in older versions of Qt.