Index: libs/libmythtv/videosource.h
===================================================================
--- libs/libmythtv/videosource.h	(revision 10285)
+++ libs/libmythtv/videosource.h	(working copy)
@@ -531,6 +531,10 @@
 class LNBLofSwitch;
 class LNBLofLo;
 class LNBLofHi;
+class LNBLofStackLo;
+class LNBLofStackHi;
+class LNBBandstacked;
+class LNBBandstackPol;
 
 class CardInput: public ConfigurationWizard
 {
@@ -584,6 +588,10 @@
     LNBLofSwitch    *lnblofswitch;
     LNBLofLo        *lnbloflo;
     LNBLofHi        *lnblofhi;
+    LNBLofStackLo   *lnblofstacklo;
+    LNBLofStackHi   *lnblofstackhi;
+    LNBBandstacked  *lnbbandstacked;
+    LNBBandstackPol *lnbbandstackpol;
     StartingChannel *startchan;
 };
 
Index: libs/libmythtv/dbcheck.cpp
===================================================================
--- libs/libmythtv/dbcheck.cpp	(revision 10285)
+++ libs/libmythtv/dbcheck.cpp	(working copy)
@@ -10,7 +10,7 @@
 #include "mythdbcon.h"
 
 /// This is the DB schema version expected by the running MythTV instance.
-const QString currentDatabaseVersion = "1146";
+const QString currentDatabaseVersion = "1147";
 
 static bool UpdateDBVersionNumber(const QString &newnumber);
 static bool performActualUpdate(const QString updates[], QString version,
@@ -2315,6 +2315,20 @@
             return false;
     }
 
+    if (dbver == "1145")
+    {
+        const QString updates[] = {
+"ALTER TABLE cardinput ADD COLUMN lnb_lof_stack_hi int(11) DEFAULT 0 AFTER lnb_lof_lo;",
+"ALTER TABLE cardinput ADD COLUMN lnb_lof_stack_lo int(11) DEFAULT 0 AFTER lnb_lof_stack_hi;",
+"ALTER TABLE cardinput ADD COLUMN bandstacked int(1) DEFAULT 0 AFTER lnb_lof_stack_lo;",
+"ALTER TABLE cardinput ADD COLUMN bandstack_pol char(1) DEFAULT "" AFTER bandstacked;",
+""
+};
+
+        if (!performActualUpdate(updates, "1146", dbver))
+            return false;
+    }
+
 //"ALTER TABLE capturecard DROP COLUMN dvb_recordts;" in 0.21
 //"ALTER TABLE capturecard DROP COLUMN dvb_hw_decoder;" in 0.21
 //"ALTER TABLE cardinput DROP COLUMN  preference;" in 0.22
Index: libs/libmythtv/dvbtypes.cpp
===================================================================
--- libs/libmythtv/dvbtypes.cpp	(revision 10285)
+++ libs/libmythtv/dvbtypes.cpp	(working copy)
@@ -581,11 +581,12 @@
 
     if (FE_QPSK == type)
     {
-        msg = QString("Frequency: %1 Symbol Rate: %2 Pol: %3 Inv: %4")
+        msg = QString("Frequency: %1 Symbol Rate: %2 Pol: %3 Inv: %4 BS: %5")
             .arg(Frequency())
             .arg(QPSKSymbolRate())
             .arg((voltage == SEC_VOLTAGE_13) ? "V/R" : "H/L")
-            .arg(InversionString());
+            .arg(InversionString())
+            .arg(bandstacked ? "Y" : "N");
     }
     else if (FE_QAM == type)
     {
@@ -682,6 +683,10 @@
     const QString& _lnb_lof_switch,
     const QString& _lnb_lof_hi,
     const QString& _lnb_lof_lo,
+    const QString& _lnb_lof_stack_hi,
+    const QString& _lnb_lof_stack_lo,
+    const QString& _bandstacked,
+    const QString& bandstack_pol,
     const QString &modulation)
 {
     bool ok = true;
@@ -702,7 +707,7 @@
         return false;
     }
 
-    voltage = parsePolarity(pol, ok);
+    voltage = parsePolarity(pol, _bandstacked, bandstack_pol, ok);
     if (SEC_VOLTAGE_OFF == voltage)
     {
         VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid polarization, aborting.");
@@ -718,6 +723,8 @@
     lnb_lof_switch = _lnb_lof_switch.toInt();
     lnb_lof_hi  = _lnb_lof_hi.toInt();
     lnb_lof_lo  = _lnb_lof_lo.toInt();
+    lnb_lof_stack_hi = _lnb_lof_stack_hi.toInt();
+    lnb_lof_stack_lo = _lnb_lof_stack_lo.toInt();
     return true;
 }
 #endif
@@ -730,7 +737,11 @@
                           const QString& _diseqc_pos,
                           const QString& _lnb_lof_switch,
                           const QString& _lnb_lof_hi,
-                          const QString& _lnb_lof_lo)
+                          const QString& _lnb_lof_lo,
+                          const QString& _lnb_lof_stack_hi,
+                          const QString& _lnb_lof_stack_lo,
+                          const QString& _bandstacked,
+                          const QString& bandstack_pol)
 {
     bool ok = true;
 
@@ -753,7 +764,7 @@
         return false;
     }
 
-    voltage = parsePolarity(pol, ok);
+    voltage = parsePolarity(pol, _bandstacked, bandstack_pol, ok);
     if (SEC_VOLTAGE_OFF == voltage)
     {
         VERBOSE(VB_IMPORTANT, LOC_ERR + "Invalid polarization, aborting.");
@@ -769,6 +780,8 @@
     lnb_lof_switch = _lnb_lof_switch.toInt();
     lnb_lof_hi  = _lnb_lof_hi.toInt();
     lnb_lof_lo  = _lnb_lof_lo.toInt();
+    lnb_lof_stack_hi = _lnb_lof_stack_hi.toInt();
+    lnb_lof_stack_lo = _lnb_lof_stack_lo.toInt();
     return true;
 }
 
@@ -823,18 +836,63 @@
     return BANDWIDTH_AUTO;
 }
 
-fe_sec_voltage DVBTuning::parsePolarity(const QString &pol, bool &ok)
+fe_sec_voltage DVBTuning::parsePolarity(const QString &pol, const QString &_bandstacked,
+                                        const QString &bandstack_pol, bool &ok)
 {
+    fe_sec_voltage voltage;
+    fe_sec_voltage voltage_stack;
+
     char polarity = QChar(pol[0]).lower();
+    char polarity_stack = QChar(bandstack_pol[0]).lower();
     ok = true;
     switch (polarity)
     {
         case 'v':
-        case 'r': return SEC_VOLTAGE_13;
+        case 'r':
+            voltage = SEC_VOLTAGE_13;
+            break;
         case 'h':
-        case 'l': return SEC_VOLTAGE_18;
-        default: return SEC_VOLTAGE_OFF;
+        case 'l':
+            voltage = SEC_VOLTAGE_18;
+            break;
+        default:
+            voltage = SEC_VOLTAGE_OFF;
     }
+
+    switch (polarity_stack)
+    {
+        case 'v':
+        case 'r':
+            voltage_stack = SEC_VOLTAGE_13;
+            break;
+        case 'h':
+        case 'l':
+            voltage_stack = SEC_VOLTAGE_18;
+            break;
+        default:
+            voltage_stack = SEC_VOLTAGE_OFF;
+    }
+
+    if (_bandstacked.toInt() && (voltage == voltage_stack))
+    {
+        bandstacked = true;
+
+        switch (voltage)
+        {
+            case SEC_VOLTAGE_13:
+                voltage = SEC_VOLTAGE_18;
+                break;
+            case SEC_VOLTAGE_18:
+                voltage = SEC_VOLTAGE_13;
+                break;
+            default:
+                voltage = SEC_VOLTAGE_OFF;
+        }
+    }
+    else
+        bandstacked = false;
+
+    return voltage;
 }
 
 fe_guard_interval DVBTuning::parseGuardInterval(const QString &gi, bool &ok)
Index: libs/libmythtv/scanwizardscanner.cpp
===================================================================
--- libs/libmythtv/scanwizardscanner.cpp	(revision 10285)
+++ libs/libmythtv/scanwizardscanner.cpp	(working copy)
@@ -276,7 +276,9 @@
     MSqlQuery query(MSqlQuery::InitCon());
     query.prepare(
         "SELECT dvb_diseqc_type, diseqc_port,  diseqc_pos, "
-        "       lnb_lof_switch,  lnb_lof_hi,   lnb_lof_lo "
+        "       lnb_lof_switch,  lnb_lof_hi,   lnb_lof_lo, "
+        "       lnb_lof_stack_hi, lnb_lof_stack_lo, "
+        "       bandstacked, bandstack_pol "
         "FROM cardinput, capturecard "
         "WHERE cardinput.cardid   = capturecard.cardid AND "
         "      cardinput.cardid   = :CARDID            AND "
@@ -298,6 +300,10 @@
         startChan["lnb_lof_switch"] = query.value(3).toString();
         startChan["lnb_lof_hi"]     = query.value(4).toString();
         startChan["lnb_lof_lo"]     = query.value(5).toString();
+        startChan["lnb_lof_stack_hi"] = query.value(6).toString();
+        startChan["lnb_lof_stack_lo"] = query.value(7).toString();
+        startChan["bandstacked"]      = query.value(8).toString();
+        startChan["bandstack_pol"]    = query.value(9).toString();
         return true;
     }
 
@@ -387,7 +393,9 @@
                 startChan["polarity"],
                 startChan["diseqc_type"], startChan["diseqc_port"],
                 startChan["diseqc_pos"],  startChan["lnb_lof_switch"],
-                startChan["lnb_lof_hi"],  startChan["lnb_lof_lo"]);
+                startChan["lnb_lof_hi"],  startChan["lnb_lof_lo"],
+                startChan["lnb_lof_stack_hi"], startChan["lnb_lof_stack_lo"],
+                startChan["bandstacked"], startChan["bandstack_pol"]);
         }
 #endif // USING_DVB
     }
Index: libs/libmythtv/siscan.cpp
===================================================================
--- libs/libmythtv/siscan.cpp	(revision 10285)
+++ libs/libmythtv/siscan.cpp	(working copy)
@@ -830,7 +830,9 @@
             startChan["polarity"],
             startChan["diseqc_type"], startChan["diseqc_port"],
             startChan["diseqc_pos"],  startChan["lnb_lof_switch"],
-            startChan["lnb_lof_hi"],  startChan["lnb_lof_lo"]);
+            startChan["lnb_lof_hi"],  startChan["lnb_lof_lo"],
+            startChan["lnb_lof_stack_hi"], startChan["lnb_lof_stack_lo"],
+            startChan["bandstacked"], startChan["bandstacked_pol"]);
     }
     else if (std == "dvb" && mod.left(3) == "qam")
     {
Index: libs/libmythtv/dvbchannel.h
===================================================================
--- libs/libmythtv/dvbchannel.h	(revision 10285)
+++ libs/libmythtv/dvbchannel.h	(working copy)
@@ -87,7 +87,9 @@
         QString frequency,    QString inversion,      QString symbolrate,
         QString fec,          QString polarity,       QString dvb_diseqc_type,
         QString diseqc_port,  QString diseqc_pos,     QString lnb_lof_switch,
-        QString lnb_lof_hi,   QString lnb_lof_lo,     QString _sistandard,
+        QString lnb_lof_hi,   QString lnb_lof_lo,     QString lnb_lof_stack_hi,
+        QString lnb_lof_stack_lo, QString bandstacked, QString bandstack_pol,
+        QString _sistandard,
         QString hp_code_rate, QString lp_code_rate,   QString constellation,
         QString trans_mode,   QString guard_interval, QString hierarchy,
         QString modulation,   QString bandwidth,      QString _input_id);
Index: libs/libmythtv/dvbtypes.h
===================================================================
--- libs/libmythtv/dvbtypes.h	(revision 10285)
+++ libs/libmythtv/dvbtypes.h	(working copy)
@@ -320,7 +320,9 @@
     DVBTuning()
       : voltage(SEC_VOLTAGE_OFF), tone(SEC_TONE_OFF), 
         diseqc_type(0), diseqc_port(0), diseqc_pos(0.0f),
-        lnb_lof_switch(0), lnb_lof_hi(0), lnb_lof_lo(0)
+        lnb_lof_switch(0), lnb_lof_hi(0), lnb_lof_lo(0),
+        lnb_lof_stack_hi(0), lnb_lof_stack_lo(0),
+        bandstacked(false)
     {
         bzero(&params, sizeof(dvb_fe_params));
     }
@@ -334,6 +336,9 @@
     unsigned int        lnb_lof_switch;
     unsigned int        lnb_lof_hi;
     unsigned int        lnb_lof_lo;
+    unsigned int        lnb_lof_stack_hi;
+    unsigned int        lnb_lof_stack_lo;
+    bool                bandstacked;
 
     bool equalQPSK(const DVBTuning& other, uint range = 0) const
         { return equal_qpsk(params, other.params, range);  }
@@ -356,13 +361,14 @@
 
     // Helper functions to parse params from DB friendly strings
     static fe_bandwidth      parseBandwidth(    const QString&, bool &ok);
-    static fe_sec_voltage    parsePolarity(     const QString&, bool &ok);
     static fe_guard_interval parseGuardInterval(const QString&, bool &ok);
     static fe_transmit_mode  parseTransmission( const QString&, bool &ok);
     static fe_hierarchy      parseHierarchy(    const QString&, bool &ok);
     static fe_spectral_inversion parseInversion(const QString&, bool &ok);
     static fe_code_rate      parseCodeRate(     const QString&, bool &ok);
     static fe_modulation     parseModulation(   const QString&, bool &ok);
+    fe_sec_voltage           parsePolarity(     const QString&, const QString&,
+                                                const QString&, bool &ok);
 
     // Helper functions for UI and DB
     uint Frequency()      const { return params.frequency; }
@@ -393,7 +399,9 @@
                    const QString& pol,            const QString& diseqc_type,
                    const QString& diseqc_port,    const QString& diseqc_pos,
                    const QString& lnb_lof_switch, const QString& lnb_lof_hi,
-                   const QString& lnb_lof_lo);
+                   const QString& lnb_lof_lo,     const QString& lnb_lof_stack_hi,
+                   const QString& lnb_lof_stack_lo, const QString& bandstacked,
+                   const QString& bandstack_pol);
 
     bool parseQAM(const QString& frequency,       const QString& inversion,
                   const QString& symbol_rate,     const QString& fec_inner,
@@ -408,7 +416,9 @@
                    const QString& pol,            const QString& diseqc_type,
                    const QString& diseqc_port,    const QString& diseqc_pos,
                    const QString& lnb_lof_switch, const QString& lnb_lof_hi,
-                   const QString& lnb_lof_lo,     const QString& modulation);
+                   const QString& lnb_lof_lo,     const QString& lnb_lof_stack_hi,
+                   const QString& lnb_lof_stack_lo, const QString& bandstacked,
+                   const QString& bandstack_pol,  const QString& modulation);
 #endif
 };
 
Index: libs/libmythtv/dvbchannel.cpp
===================================================================
--- libs/libmythtv/dvbchannel.cpp	(revision 10285)
+++ libs/libmythtv/dvbchannel.cpp	(working copy)
@@ -408,7 +408,9 @@
         "SELECT frequency,         inversion,      symbolrate, "
         "       fec,               polarity,       dvb_diseqc_type, "
         "       diseqc_port,       diseqc_pos,     lnb_lof_switch, "
-        "       lnb_lof_hi,        lnb_lof_lo,     sistandard, "
+        "       lnb_lof_hi,        lnb_lof_lo,     lnb_lof_stack_hi, "
+        "       lnb_lof_stack_lo, "
+        "       bandstacked,       bandstack_pol,  sistandard, "
         "       hp_code_rate,      lp_code_rate,   constellation, "
         "       transmission_mode, guard_interval, hierarchy, "
         "       modulation,        bandwidth,      cardinputid "
@@ -447,7 +449,9 @@
         query.value(14).toString(), query.value(15).toString(),
         query.value(16).toString(), query.value(17).toString(),
         query.value(18).toString(), query.value(19).toString(),
-        query.value(20).toString());
+        query.value(20).toString(), query.value(21).toString(),
+        query.value(22).toString(), query.value(23).toString(),
+        query.value(23).toString());
 }
 
 bool DVBChannel::ParseTuningParams(
@@ -455,7 +459,9 @@
     QString frequency,    QString inversion,      QString symbolrate,
     QString fec,          QString polarity,       QString dvb_diseqc_type,
     QString diseqc_port,  QString diseqc_pos,     QString lnb_lof_switch,
-    QString lnb_lof_hi,   QString lnb_lof_lo,     QString _sistandard,
+    QString lnb_lof_hi,   QString lnb_lof_lo,     QString lnb_lof_stack_hi,
+    QString lnb_lof_stack_lo,
+    QString bandstacked,  QString bandstack_pol,  QString _sistandard,
     QString hp_code_rate, QString lp_code_rate,   QString constellation,
     QString trans_mode,   QString guard_interval, QString hierarchy,
     QString modulation,   QString bandwidth,      QString _input_id)
@@ -467,7 +473,8 @@
         return cur_tuning.parseQPSK(
             frequency,       inversion,     symbolrate,   fec,   polarity,
             dvb_diseqc_type, diseqc_port,   diseqc_pos,
-            lnb_lof_switch,  lnb_lof_hi,    lnb_lof_lo);
+            lnb_lof_switch,  lnb_lof_hi,    lnb_lof_lo,   lnb_lof_stack_hi,
+            lnb_lof_stack_lo, bandstacked,  bandstack_pol);
     else if (FE_QAM == type)
         return cur_tuning.parseQAM(
             frequency,       inversion,     symbolrate,   fec,   modulation);
@@ -483,7 +490,8 @@
         return cur_tuning.parseDVBS2(
             frequency,       inversion,     symbolrate,   fec,   polarity,
             dvb_diseqc_type, diseqc_port,   diseqc_pos,
-            lnb_lof_switch,  lnb_lof_hi,    lnb_lof_lo, modulation);
+            lnb_lof_switch,  lnb_lof_hi,    lnb_lof_lo,   lnb_lof_stack_hi,
+            lnb_lof_stack_lo, bandstacked,  bandstack_pol, modulation);
 #endif // FE_GET_EXTENDED_INFO
    
     return false;
@@ -864,10 +872,24 @@
         return tuning.Frequency();
 #endif
 
+    unsigned int lnb_lof_hi;
+    unsigned int lnb_lof_lo;
+
+    if (tuning.bandstacked)
+    {
+        lnb_lof_hi = tuning.lnb_lof_stack_hi;
+        lnb_lof_lo = tuning.lnb_lof_stack_lo;
+    }
+    else
+    {
+        lnb_lof_hi = tuning.lnb_lof_hi;
+        lnb_lof_lo = tuning.lnb_lof_lo;
+    }
+
     uint freq   = tuning.Frequency();
     bool tone   = freq >= tuning.lnb_lof_switch;
-    uint lnb_hi = (uint) abs((int)freq - (int)tuning.lnb_lof_hi);
-    uint lnb_lo = (uint) abs((int)freq - (int)tuning.lnb_lof_lo);
+    uint lnb_hi = (uint) abs((int)freq - (int)lnb_lof_hi);
+    uint lnb_lo = (uint) abs((int)freq - (int)lnb_lof_lo);
 
     if (p_tone)
         *p_tone = (tone) ? SEC_TONE_ON : SEC_TONE_OFF;
Index: libs/libmythtv/videosource.cpp
===================================================================
--- libs/libmythtv/videosource.cpp	(revision 10285)
+++ libs/libmythtv/videosource.cpp	(working copy)
@@ -1511,6 +1511,56 @@
     };
 };
 
+class LNBLofStackHi: public LineEditSetting, public CISetting {
+  public:
+    LNBLofStackHi(const CardInput& parent):
+        CISetting(parent, "lnb_lof_stack_hi") {
+        setLabel(QObject::tr("Bandstacked LNB LOF High"));
+        setValue("13700000");
+        setHelpText(QObject::tr("This defines the offset (in Hz) the "
+                    "frequency coming from the bandstacked LNB polarity "
+                    "will be in high setting."));
+    };
+};
+
+class LNBLofStackLo: public LineEditSetting, public CISetting {
+  public:
+    LNBLofStackLo(const CardInput& parent):
+        CISetting(parent, "lnb_lof_stack_lo") {
+        setLabel(QObject::tr("Bandstacked LNB LOF Low"));
+        setValue("12850000");
+        setHelpText(QObject::tr("This defines the offset (in Hz) the "
+                    "frequency coming from the bandstacked LNB polarity "
+                    "will be in low setting."));
+    };
+};
+
+class LNBBandstacked: public CheckBoxSetting, public CISetting {
+  public:
+    LNBBandstacked(const CardInput& parent):
+        CISetting(parent, "bandstacked")
+    {
+        setValue(false);
+        setLabel(QObject::tr("This is a bandstacked LNB."));
+        setHelpText(QObject::tr("Set this if your LNB is bandstacked "
+                    "(Dish Network DishPro LNBFs for example)"));
+    };
+};
+
+class LNBBandstackPol: public ComboBoxSetting, public CISetting
+{
+  public:
+    LNBBandstackPol(const CardInput& parent):
+        CISetting(parent, "bandstack_pol") {
+        setLabel("LNB Bandstack Polarity:");
+        addSelection(QObject::tr("No Bandstacking"), "");
+        addSelection(QObject::tr("Horizontal/Left"), "h");
+        addSelection(QObject::tr("Verticle/Right"), "v");
+        setHelpText(QObject::tr("For bandstacked LNBs, select the polarity "
+                    "which is bandstacked."));
+    };
+};
+
 class DiSEqCPos: public LineEditSetting, public CISetting
 {
   public:
@@ -1751,6 +1801,10 @@
         dvbgroup->addChild(lnblofswitch = new LNBLofSwitch(*this));
         dvbgroup->addChild(lnblofhi = new LNBLofHi(*this));
         dvbgroup->addChild(lnbloflo = new LNBLofLo(*this));
+        dvbgroup->addChild(lnbbandstacked = new LNBBandstacked(*this));
+        dvbgroup->addChild(lnblofstacklo = new LNBLofStackLo(*this));
+        dvbgroup->addChild(lnblofstackhi = new LNBLofStackHi(*this));
+        dvbgroup->addChild(lnbbandstackpol = new LNBBandstackPol(*this));
 
         dvbgroup->addChild(new FreeToAir(*this));
         dvbgroup->addChild(new RadioServices(*this));
@@ -1885,6 +1939,10 @@
             lnblofswitch->setVisible(true);
             lnbloflo->setVisible(true);
             lnblofhi->setVisible(true);
+            lnblofstackhi->setVisible(true);
+            lnblofstacklo->setVisible(true);
+            lnbbandstacked->setVisible(true);
+            lnbbandstackpol->setVisible(true);
 
             DISEQC_TYPES dt = CardUtil::GetDISEqCType(_cardid);
             bool pos = (dt == DISEQC_POSITIONER_X);
@@ -1896,6 +1954,10 @@
             lnblofswitch->setVisible(false);
             lnbloflo->setVisible(false);
             lnblofhi->setVisible(false);
+            lnblofstackhi->setVisible(false);
+            lnblofstacklo->setVisible(false);
+            lnbbandstacked->setVisible(false);
+            lnbbandstackpol->setVisible(false);
         }
     }
 }
