Opened 20 years ago
Closed 20 years ago
Last modified 20 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)
by , 20 years ago
| Attachment: | mythtv.printexpire.diff added |
|---|
comment:1 by , 20 years ago
comment:2 by , 20 years ago
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 by , 20 years ago
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 ...
by , 20 years ago
| Attachment: | mythtv.printexpire.2.diff added |
|---|
Use stringToLongLong instead of toLongLong
comment:4 by , 20 years ago
| 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 by , 20 years ago
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.