=== programs/mythbackend/eitactivescanner.cpp
==================================================================
--- programs/mythbackend/eitactivescanner.cpp	(revision 239)
+++ programs/mythbackend/eitactivescanner.cpp	(local)
@@ -59,8 +59,6 @@
     if (ismaster)
         StartActiveScan();
 
-
-
     while (!exitThread)
     {
         QDateTime now = QDateTime::currentDateTime();
@@ -88,25 +86,27 @@
                         .arg(nextCard.key()));
                 continue;
             }
+            uint sid = *source;
             int cardid = nextCard.key();
 
 
-            if (!(*(nextChan[*source])).isEmpty() &&
-                (*cardList)[cardid]->StartEITScan(*(nextChan[*source])))
+            if (!(*(nextChan[sid])).isEmpty() &&
+                (*cardList)[cardid]->StartEITScan(*(nextChan[sid])))
             {
                 VERBOSE(VB_GENERAL, QString("DVB(%1): Now looking for EIT "
                                             "data on multiplex of channel %2 "
                                             "of source %3")
-                        .arg(cardid).arg(*(nextChan[*source])).arg(*source));
+                        .arg(cardid).arg(*(nextChan[sid])).arg(sid));
                 /* advace to the next channel and test for valid iterator.
                    needed to simplify selection of the source
                    with the highest priority. */
-                nextChan[*source]++;
-                if (nextChan[*source] == channels[*source].end())
+                nextChan[sid]++;
+                if (nextChan[sid] == channels[sid].end())
                 {
-                    nextChan[*source] = channels[*source].begin();
-                    sources.push_back(*source);
+                    nextChan[sid] = channels[sid].begin();
                     sources.erase(source);
+                    sources.push_back(sid);
+                    //cerr << "Moved source " << sid << " to the back of the queue." << endl; 
                 }
             }
             else
@@ -114,7 +114,7 @@
                 VERBOSE(VB_GENERAL, QString("Skipping card %1 in scan for EIT "
                                             "data on multiplex of channel %2 "
                                             "of source %3")
-                        .arg(cardid).arg(*(nextChan[*source])).arg(*source));
+                        .arg(cardid).arg(*(nextChan[sid])).arg(sid));
             }
 
             nextTriggerTime = QDateTime::currentDateTime().addSecs(triggerTime);
