Skip to content

Commit

Permalink
Don't call positionMapTimer.elapsed() until timer is running.
Browse files Browse the repository at this point in the history
We actually ignore the value returned until positionMapTimer.start() has
been called, so this won't cause any program misbehaviour. But we might
as well use the timer API as intended.
  • Loading branch information
daniel-kristjansson committed Jan 27, 2013
1 parent 926464a commit 309c97e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/recorders/recorderbase.cpp
Expand Up @@ -472,7 +472,8 @@ void RecorderBase::SavePositionMap(bool force)
positionMapLock.lock();

uint delta_size = positionMapDelta.size();
uint pm_elapsed = positionMapTimer.elapsed();
uint pm_elapsed = (positionMapTimer.isRunning()) ?
positionMapTimer.elapsed() : 0;
// save on every 1.5 seconds if in the first few frames of a recording
needToSave |= (positionMap.size() < 30) &&
(delta_size >= 1) && (pm_elapsed >= 1500);
Expand Down

0 comments on commit 309c97e

Please sign in to comment.