diff -urN vdr-1.0.0pre4/config.c vdr-1.0.0pre4-ml/config.c
--- vdr-1.0.0pre4/config.c	Sun Mar 17 15:24:09 2002
+++ vdr-1.0.0pre4-ml/config.c	Fri Mar 22 13:36:18 2002
@@ -293,13 +293,56 @@
 
 bool cChannel::Switch(cDvbApi *DvbApi, bool Log)
 {
-  if (!DvbApi)
+//ML
+  cDvbApi *tmpApi;  if (!DvbApi)
+
+
      DvbApi = cDvbApi::PrimaryDvbApi;
+//ML
+  if (DvbApi->ChkRPol(polarization) >= 0) {
+     Interface->Error(tr("Polarisation blockiert!"));
+     return false;
+  }
+
+
   if (!DvbApi->Recording() && !groupSep) {
      if (Log)
         isyslog(LOG_INFO, "switching to channel %d", number);
      for (int i = 3; i--;) {
+//ML
+         while ((tmpApi = DvbApi->ChkOPol(polarization)) != NULL) {
+           tmpApi->SetChannel(number, frequency, polarization, diseqc, srate, vpid, apid1, apid2, dpid1, dpid2, tpid, ca, pnr);
+         }
+
+
          switch (DvbApi->SetChannel(number, frequency, polarization, diseqc, srate, vpid, apid1, apid2, dpid1, dpid2, tpid, ca, pnr)) {
+           case scrOk:         return true;
+           case scrNoTransfer: if (Interface)
+                                  Interface->Error(tr("Can't start Transfer Mode!"));
+                               return false;
+           case scrFailed:     break; // loop will retry
+           }
+         esyslog(LOG_ERR, "retrying");
+         }
+     return false;
+     }
+  if (DvbApi->Recording())
+     Interface->Error(tr("Channel locked (recording)!"));
+  return false;
+}
+
+//ML
+bool cChannel::SwitchForced(cDvbApi *DvbApi, bool Log)
+{
+
+  if (!DvbApi)
+     DvbApi = cDvbApi::PrimaryDvbApi;
+
+  if (!DvbApi->Recording() && !groupSep) {
+     if (Log)
+        isyslog(LOG_INFO, "switching to channel %d", number);
+     for (int i = 3; i--;) {
+	 switch (DvbApi->SetChannel(number, frequency, polarization, diseqc, srate, vpid, apid1, apid2, dpid1, dpid2, tpid, ca, pnr)) {
            case scrOk:         return true;
            case scrNoTransfer: if (Interface)
                                   Interface->Error(tr("Can't start Transfer Mode!"));
diff -urN vdr-1.0.0pre4/config.h vdr-1.0.0pre4-ml/config.h
--- vdr-1.0.0pre4/config.h	Sun Mar 17 15:24:11 2002
+++ vdr-1.0.0pre4-ml/config.h	Fri Mar 22 13:52:44 2002
@@ -119,6 +119,10 @@
   bool Parse(const char *s);
   bool Save(FILE *f);
   bool Switch(cDvbApi *DvbApi = NULL, bool Log = true);
+//ML
+  bool SwitchForced(cDvbApi *DvbApi = NULL, bool Log = true);
+
+
   };
 
 enum eTimerActive { taInactive = 0,
diff -urN vdr-1.0.0pre4/dvbapi.c vdr-1.0.0pre4-ml/dvbapi.c
--- vdr-1.0.0pre4/dvbapi.c	Sat Mar 16 15:20:47 2002
+++ vdr-1.0.0pre4-ml/dvbapi.c	Fri Mar 22 13:42:50 2002
@@ -1815,6 +1815,28 @@
   return ShiftLevel;
 }
 
+//ML
+cDvbApi *cDvbApi::ChkOPol(char pol)
+{
+  for (int i = 0; i < NumDvbApis; i++) {
+    if (this != dvbApi[i] && dvbApi[i]->Polar() != pol)
+      return dvbApi[i];
+  }
+  return NULL;
+}
+
+//ML
+int cDvbApi::ChkRPol(char pol)
+{
+  int d = -1;
+  for (int i = 0; i < NumDvbApis; i++) {
+    if (this != dvbApi[i] && dvbApi[i]->Polar() != pol && dvbApi[i]->Recording()) {
+      if (dvbApi[i]->priority > d) d = dvbApi[i]->priority;
+      }
+  }
+  return d;
+}
+
 cDvbApi *cDvbApi::GetDvbApi(int Ca, int Priority)
 {
   cDvbApi *d = NULL;
@@ -2301,6 +2323,11 @@
 
 eSetChannelResult cDvbApi::SetChannel(int ChannelNumber, int Frequency, char Polarization, int Diseqc, int Srate, int Vpid, int Apid1, int Apid2, int Dpid1, int Dpid2, int Tpid, int Ca, int Pnr)
 {
+//ML
+  int res;
+  FrontendEvent event;
+
+
   StopTransfer();
   StopReplay();
 
@@ -2332,7 +2359,10 @@
   // start replaying in Transfer Mode immediately after switching the channel:
   bool NeedsTransferMode = (this == PrimaryDvbApi && !ProvidesCa(Ca));
 
-  if (!NeedsTransferMode) {
+//ML
+  if (!NeedsTransferMode || Mpolar != Polarization) {
+//  if (!NeedsTransferMode) {
+
 
      // Turn off current PIDs:
 
@@ -2386,6 +2416,10 @@
             scmds.commands = &scmd;
 
             CHECK(ioctl(fd_sec, SEC_SEND_SEQUENCE, &scmds));
+ //ML
+	    Mpolar = Polarization;
+
+
             }
             break;
        case FE_QAM: { // DVB-C
@@ -2422,12 +2456,18 @@
      // Tuning:
 
      CHECK(ioctl(fd_frontend, FE_SET_FRONTEND, &Frontend));
+     if (cFile::FileReady(fd_frontend, 5000)) {
+        res = ioctl(fd_frontend, FE_GET_EVENT, &event);
+           }
+        else
+           esyslog(LOG_ERR, "ERROR %d in frontend get event (channel %d, card %d)", res, ChannelNumber, CardIndex() + 1);
+//ML
+  }
+  if (!NeedsTransferMode) {
 
      // Wait for channel sync:
 
-     if (cFile::FileReady(fd_frontend, 5000)) {
-        FrontendEvent event;
-        int res = ioctl(fd_frontend, FE_GET_EVENT, &event);
+
         if (res >= 0) {
            if (event.type != FE_COMPLETION_EV) {
               esyslog(LOG_ERR, "ERROR: channel %d not sync'ed on DVB card %d!", ChannelNumber, CardIndex() + 1);
@@ -2435,13 +2475,12 @@
                  cThread::RaisePanic();
               return scrFailed;
               }
-           }
-        else
-           esyslog(LOG_ERR, "ERROR %d in frontend get event (channel %d, card %d)", res, ChannelNumber, CardIndex() + 1);
+
         }
      else
         esyslog(LOG_ERR, "ERROR: timeout while tuning");
 
+
      // PID settings:
 
      if (!SetPids(false)) {
@@ -2791,8 +2830,12 @@
                               numTransponders = 0;
                               }
                            cChannel *Channel = Channels.GetByNumber(ch);
-                           if (Channel && Channel->pnr && !TransponderScanned(Channel)) {
-                              if (DvbApi == cDvbApi::PrimaryDvbApi && !currentChannel)
+ //ML
+//                          if (Channel && Channel->pnr && !TransponderScanned(Channel)) {
+                            if (Channel && Channel->pnr && !TransponderScanned(Channel) && !(DvbApi->ChkOPol(Channel->polarization) && Setup.EPGScanTimeout && now - lastActivity <= Setup.EPGScanTimeout * 3600)) {
+
+
+                             if (DvbApi == cDvbApi::PrimaryDvbApi && !currentChannel)
                                  currentChannel = DvbApi->Channel();
                               Channel->Switch(DvbApi, false);
                               lastChannel = ch;
diff -urN vdr-1.0.0pre4/dvbapi.h vdr-1.0.0pre4-ml/dvbapi.h
--- vdr-1.0.0pre4/dvbapi.h	Sun Mar 10 11:50:00 2002
+++ vdr-1.0.0pre4-ml/dvbapi.h	Fri Mar 22 13:58:51 2002
@@ -114,6 +114,13 @@
   static bool SetPrimaryDvbApi(int n);
          // Sets the primary DVB device to 'n' (which must be in the range
          // 1...NumDvbApis) and returns true if this was possible.
+//ML
+  cDvbApi *ChkOPol(char pol);
+         // Gibt eine DVB-Karte zurück, die auf eine andere Polarisation eingestellt ist
+  int ChkRPol(char pol);
+         // Gibt die höchte Priorität aller Karten mit anderer Polarisation zurück
+
+
   static cDvbApi *GetDvbApi(int Ca, int Priority);
          // Selects a free DVB device, avoiding the PrimaryDvbApi if possible.
          // If Ca is not 0, the device with the given number will be returned
@@ -186,6 +193,13 @@
   // Video format facilities:
 
   void SetVideoFormat(videoFormat_t Format);
+
+//ML
+private:
+  char Mpolar;
+public:
+  char Polar(void) { return Mpolar; }
+
 
   // Channel facilities
 
diff -urN vdr-1.0.0pre4/menu.c vdr-1.0.0pre4-ml/menu.c
--- vdr-1.0.0pre4/menu.c	Sun Mar 17 15:23:44 2002
+++ vdr-1.0.0pre4-ml/menu.c	Fri Mar 22 13:50:41 2002
@@ -2796,10 +2796,22 @@
 {
   int ch = Timer ? Timer->channel : cDvbApi::CurrentChannel();
   cChannel *channel = Channels.GetByNumber(ch);
+//ML
+  cDvbApi *tmpApi;
+
 
   if (channel) {
      cDvbApi *dvbApi = cDvbApi::GetDvbApi(channel->ca, Timer ? Timer->priority : Setup.DefaultPriority);
-     if (dvbApi) {
+//ML
+
+     if (dvbApi && (dvbApi->ChkRPol(channel->polarization) < (Timer ? Timer->priority : Setup.DefaultPriority))) {
+       while ((tmpApi = dvbApi->ChkOPol(channel->polarization))) {
+         Stop(tmpApi);
+	 channel->SwitchForced(tmpApi, true);
+	}
+//     if (dvbApi) {
+
+
         Stop(dvbApi);
         for (int i = 0; i < MAXDVBAPI; i++) {
             if (!RecordControls[i]) {
@@ -2808,8 +2820,15 @@
                }
             }
         }
-     else if (!Timer || (Timer->priority >= Setup.PrimaryLimit && !Timer->pending))
-        isyslog(LOG_ERR, "no free DVB device to record channel %d!", ch);
+//ML
+     else
+       if (!Timer || (Timer->priority >= Setup.PrimaryLimit && !Timer->pending))
+// elseif (!Timer || (Timer->priority >= Setup.PrimaryLimit && !Timer->pending))
+
+         isyslog(LOG_ERR, "no free DVB device to record channel %d!", ch);
+//ML
+       if (dvbApi && dvbApi->ChkRPol(channel->polarization) >= Timer->priority)
+         isyslog(LOG_ERR, "Aufnahme mit anderer Polarisation hat höhere Priorität!");
      }
   else
      esyslog(LOG_ERR, "ERROR: channel %d not defined!", ch);
