All pastes #251249 Raw Edit

Unnamed

public text v1 · immutable
#251249 ·published 2006-11-17 22:53 UTC
rendered paste body
--- a/mythtv/libs/libmythtv/programinfo.cpp
+++ b/mythtv/libs/libmythtv/programinfo.cpp
@@ -731,22 +731,12 @@ ProgramInfo *ProgramInfo::GetProgramAtDa
         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));
-    }
+    p->endts.setTime(QTime(p->endts.time().hour(), (p->endts.time().minute() / 2) * 2));
+    p->endts = p->endts.addSecs(2 * 60);
 
     // 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;