[mythtv] Ticket #10414: HDHomeRun: Bad Recordings
Daniel Kristjansson
danielk at cuymedia.net
Mon Mar 12 12:50:30 UTC 2012
On Sun, 2012-03-11 at 15:29 -0500, David Engel wrote:
> Daniel, I traced my high CPU usage to the following commit.
> Specifically, it is the following code in DTVRecorder::BufferedWrite().
>
> if (!timeOfFirstData.isValid() && curRecording)
> {
> QMutexLocker locker(&statisticsLock);
> timeOfFirstData = mythCurrentDateTime();
> }
>
> uint64_t now = mythCurrentDateTime().toTime_t();
> if (!timeOfLatestData.isValid() || (now - timeOfLatestData.toTime_t() >= 5))
> {
> QMutexLocker locker(&statisticsLock);
> timeOfLatestData = mythCurrentDateTime();
> }
Makes sense, QDateTime can take up crazy amounts of CPU. I'll rework
this so we only need to look up the time every five seconds or so.
-- Daniel
More information about the mythtv-dev
mailing list