Index: mythtv/libs/libmythtv/programinfo.h
===================================================================
--- mythtv/libs/libmythtv/programinfo.h	(revision 12478)
+++ mythtv/libs/libmythtv/programinfo.h	(working copy)
@@ -13,7 +13,7 @@
 typedef QMap<long long, long long> frm_pos_map_t;
 typedef QMap<long long, int> frm_dir_map_t;
 
-#define NUMPROGRAMLINES 43
+#define NUMPROGRAMLINES 45
 
 typedef enum {
     MARK_UNSET = -10,
@@ -290,6 +290,8 @@
     QDateTime endts;
     QDateTime recstartts;
     QDateTime recendts;
+    int softstart;
+    int softend;
 
     AvailableStatusType availableStatus;
     
Index: mythtv/libs/libmythtv/programinfo.cpp
===================================================================
--- mythtv/libs/libmythtv/programinfo.cpp	(revision 12478)
+++ mythtv/libs/libmythtv/programinfo.cpp	(working copy)
@@ -96,6 +96,8 @@
     endts = startts;
     recstartts = startts;
     recendts = startts;
+    softstart = 0;
+    softend = 0;
     originalAirDate = QDate::QDate (0, 1, 1);
     lastmodified = startts;
     lastInUseTime = startts.addSecs(-4 * 60 * 60);
@@ -189,6 +191,8 @@
     endts = other.endts;
     recstartts = other.recstartts;
     recendts = other.recendts;
+    softstart = other.softstart;
+    softend = other.softend;
     lastmodified = other.lastmodified;
     spread = other.spread;
     startCol = other.startCol;
@@ -324,6 +328,8 @@
     INT_TO_LIST(recpriority2)
     INT_TO_LIST(parentid)
     STR_TO_LIST((storagegroup != "") ? storagegroup : "Default")
+    INT_TO_LIST(softstart)
+    INT_TO_LIST(softend)
 }
 
 /** \fn ProgramInfo::FromStringList(QStringList&,int)
@@ -423,6 +429,8 @@
     INT_FROM_LIST(recpriority2)
     INT_FROM_LIST(parentid)
     STR_FROM_LIST(storagegroup)
+    INT_FROM_LIST(softstart)
+    INT_FROM_LIST(softend)
 
     return true;
 }
@@ -449,6 +457,7 @@
 
     QString length;
     int hours, minutes, seconds;
+    int startoffset, endoffset;
     
     progMap["title"] = title;
     progMap["subtitle"] = subtitle;
@@ -478,6 +487,8 @@
             progMap["startdate"] = startts.toString("yyyy");
             progMap["recstartdate"] = startts.toString("yyyy");
         }
+        startoffset = 0;
+        endoffset = 0;
     }
     else
     {
@@ -489,8 +500,23 @@
         progMap["recstartdate"] = recstartts.toString(shortDateFormat);
         progMap["recendtime"] = recendts.toString(timeFormat);
         progMap["recenddate"] = recendts.toString(shortDateFormat);
+        startoffset = recstartts.secsTo(startts) / 60;
+        endoffset = endts.secsTo(recendts) / 60;
     }
     
+    if (startoffset)
+        progMap["startoffset"].sprintf("%+d", startoffset);
+    else
+        progMap["startoffset"] = "";
+    
+    if (endoffset)
+        progMap["endoffset"].sprintf("%+d", endoffset);
+    else
+        progMap["endoffset"] = "";
+    
+    progMap["softstart"].sprintf("%+d", softstart);
+    progMap["softend"].sprintf("%+d", softend);
+    
     progMap["lastmodifiedtime"] = lastmodified.toString(timeFormat);
     progMap["lastmodifieddate"] = lastmodified.toString(dateFormat);
     progMap["lastmodified"] = lastmodified.toString(dateFormat) + " " +
@@ -560,14 +586,18 @@
     progMap["playgroup"] = playgroup;
     progMap["programflags"] = programflags;
 
+    QString offsetstr = "";
+    if (startoffset || endoffset)
+        offsetstr.sprintf(" (%+d %+d)", startoffset, endoffset);
+
     progMap["timedate"] = recstartts.date().toString(dateFormat) + ", " +
                           recstartts.time().toString(timeFormat) + " - " +
-                          recendts.time().toString(timeFormat);
+                          recendts.time().toString(timeFormat) + offsetstr;
 
     progMap["shorttimedate"] =
                           recstartts.date().toString(shortDateFormat) + ", " +
                           recstartts.time().toString(timeFormat) + " - " +
-                          recendts.time().toString(timeFormat);
+                          recendts.time().toString(timeFormat) + offsetstr;
 
     progMap["time"] = timeNow.time().toString(timeFormat);
 
Index: mythtv/programs/mythfrontend/globalsettings.cpp
===================================================================
--- mythtv/programs/mythfrontend/globalsettings.cpp	(revision 12478)
+++ mythtv/programs/mythfrontend/globalsettings.cpp	(working copy)
@@ -641,6 +641,34 @@
     return bs;
 }
 
+static GlobalSpinBox *SchedSoftStart()
+{
+    GlobalSpinBox *bs = new GlobalSpinBox("SchedSoftStart", 0, 10, 1, true);
+    bs->setLabel(QObject::tr("Time to schedule before start of show "
+                 "(in minutes)"));
+    bs->setHelpText(QObject::tr("This global setting tells the scheduler "
+                    "to change the start time for all shows. It is only "
+                    "removed when there is no free recorders and for equal "
+                    "or lower priority shows. Reschedule Higher "
+                    "Priorities is need for removal on all shows."));
+    bs->setValue(0);
+    return bs;
+}
+
+static GlobalSpinBox *SchedSoftEnd()
+{
+    GlobalSpinBox *bs = new GlobalSpinBox("SchedSoftEnd", 0, 30, 1, true);
+    bs->setLabel(QObject::tr("Time to schedule past end of show (in minutes)"));
+    bs->setValue(0);
+    bs->setHelpText(QObject::tr("This global setting tells the scheduler "
+                    "to change the end time for all shows. It is only "
+                    "removed when there is no free recorders and for equal "
+                    "or lower priority shows. Reschedule Higher "
+                    "Priorities is need for removal on all shows. This end "
+                    "time is preferred with respect to previous start time."));
+    return bs;
+}
+
 static GlobalLineEdit *OverTimeCategory()
 {
     GlobalLineEdit *ge = new GlobalLineEdit("OverTimeCategory");
@@ -3662,6 +3690,9 @@
     general2->setLabel(QObject::tr("General (Advanced)"));
     general2->addChild(RecordPreRoll());
     general2->addChild(RecordOverTime());
+    // These calls should remain as stubs so that they can be uncommeted by common patches
+    // general2->addChild(SchedSoftStart());
+    // general2->addChild(SchedSoftEnd());
     general2->addChild(CategoryOverTimeSettings());
     general2->addChild(ATSCCheckSignalThreshold());
     general2->addChild(ATSCCheckSignalWait());
Index: mythplugins/mythweb/modules/tv/includes/objects/Program.php
===================================================================
--- mythplugins/mythweb/modules/tv/includes/objects/Program.php	(revision 12478)
+++ mythplugins/mythweb/modules/tv/includes/objects/Program.php	(working copy)
@@ -63,6 +63,8 @@
     var $recpriority2   = 0;
     var $parentid;
     var $storagegroup   = 'Default';
+    var $softstart
+    var $softend
 
 // The rest of these variables (which really need to get organized) are
 // calculated or queried separately from the db.
@@ -142,6 +144,8 @@
             $this->recpriority2    = $data[40];
             $this->parentid        = $data[41];
             $this->storagegroup    = $data[42];
+            $this->softstart       = $data[43];
+            $this->softend         = $data[44];
         // Is this a previously-recorded program?
             if (!empty($this->filename)) {
             // Calculate the filesize
@@ -355,7 +359,9 @@
                              $this->recpriority2   , // 40 recpriority2
                              $this->parentid       , // 41 parentid
                              $this->storagegroup   , // 42 storagegroup
-                             '',                     // 43 trailing separator
+                             $this->softstart      , // 43 softstart
+                             $this->softend        , // 44 softend
+                             '',                     // 45 trailing separator
                             )
                       );
     }
