diff --git a/mythtv/libs/libmythtv/programinfo.cpp b/mythtv/libs/libmythtv/programinfo.cpp index fb45720..3bcc88f 100644 --- a/mythtv/libs/libmythtv/programinfo.cpp +++ b/mythtv/libs/libmythtv/programinfo.cpp @@ -730,23 +730,16 @@ ProgramInfo *ProgramInfo::GetProgramAtDa if (!genUnknown) return p; - // Round endtime up to the next half-hour. - if (p->endts.time().minute() < 30) - p->endts.setTime(QTime(p->endts.time().hour(), 30)); - else - { - if (p->endts.time().hour() == 23) - { - p->endts = p->endts.addDays(1); - p->endts.setTime(QTime(0, 0)); - } - else - p->endts.setTime(QTime(p->endts.time().hour() + 1, 0)); - } + // Round endtime up to the next two minutes + int minute = (p->endts.time().minute() / 2) * 2 + 2; + int hour = minute ? p->endts.time().hour() : p->endts.time().hour()+1; + if (!hour && ! minute) + p->endts = p->endts.addDays(1); + p->endts.setTime(QTime(hour, minute)); // if under a minute, bump it up to the next half hour if (p->startts.secsTo(p->endts) < 60) - p->endts = p->endts.addSecs(30 * 60); + p->endts = p->endts.addSecs(2 * 60); p->recendts = p->endts;