Skip to content

Commit

Permalink
libmythtv: Fix visualisation build for older Qt versions.
Browse files Browse the repository at this point in the history
... and add some bounds checking for the rollover into the next day:)
  • Loading branch information
Mark Kendall committed Mar 22, 2011
1 parent 8fe7f45 commit 3a6cabf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/visualisations/videovisual.cpp
Expand Up @@ -57,7 +57,7 @@ VideoVisual::~VideoVisual()
int64_t VideoVisual::SetLastUpdate(void)
{
QDateTime now = QDateTime::currentDateTime();
int64_t result = m_lastUpdate.msecsTo(now);
int64_t result = m_lastUpdate.time().msecsTo(now.time());
m_lastUpdate = now;
return result;
}
Expand Down
4 changes: 4 additions & 0 deletions mythtv/libs/libmythtv/visualisations/videovisualspectrum.cpp
Expand Up @@ -77,6 +77,10 @@ void VideoVisualSpectrum::Draw(const QRect &area, MythPainter *painter,

double magL, magR, tmp;
double falloff = (((double)SetLastUpdate()) / 40.0) * m_falloff;
if (falloff < 0.0)
falloff = 0.0;
if (falloff > 2048.0)
falloff = 2048.0;
for (int l = 0, r = m_scale.range(); l < m_scale.range(); l++, r++)
{
int index = m_scale[l];
Expand Down

0 comments on commit 3a6cabf

Please sign in to comment.