Skip to content

Commit

Permalink
Rewrite ProgramInfo::GetSecondsInRecording() so it works in Qt5.
Browse files Browse the repository at this point in the history
QDateTime::secsTo() returns a qint64 instead of an int in Qt5.
This tweaks things so the code compiles with both Qt4 and Qt5.
  • Loading branch information
daniel-kristjansson authored and jyavenard committed Mar 8, 2013
1 parent 5da62ae commit efd7d42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mythtv/libs/libmyth/programinfo.cpp
Expand Up @@ -1705,8 +1705,9 @@ void ProgramInfo::ToMap(InfoMap &progMap,
/// \brief Returns length of program/recording in seconds.
uint ProgramInfo::GetSecondsInRecording(void) const
{
int recsecs = recstartts.secsTo(endts);
return (uint) ((recsecs>0) ? recsecs : max(startts.secsTo(endts),0));
int64_t recsecs = recstartts.secsTo(endts);
int64_t duration = startts.secsTo(endts);
return (uint) ((recsecs>0) ? recsecs : max(duration,int64_t(0)));
}

/// \brief Returns last frame in position map or 0
Expand Down

0 comments on commit efd7d42

Please sign in to comment.