[mythtv] Directv and channel changing problem

Andy Davidoff dert at pobox.com
Wed Mar 5 22:01:34 EST 2003


OMG!  This was painful to read. :-(

Use the attached patch and the ExternalChannelsForTV boolean in your
settings table:
	insert into settings values ('ExternalChannelsForTV','1',NULL);

Let me know if this does the trick.

People with cable boxes that decrypt premium channels will need this
feature as well if using the normal coax input...


#if Brad Coleman /* Mar 05, 20:20 */
> I had the same exact setup (DSS coax into "Television" input) and had to
> jump through some hoops for it to work.
#endif /* bradkcoleman at softhome.net */
-------------- next part --------------
Index: MC/libs/libmythtv/channel.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/channel.cpp,v
retrieving revision 1.29
diff -d -u -w -r1.29 channel.cpp
--- MC/libs/libmythtv/channel.cpp	3 Mar 2003 15:42:11 -0000	1.29
+++ MC/libs/libmythtv/channel.cpp	6 Mar 2003 02:57:46 -0000
@@ -25,6 +25,7 @@
     videomode = VIDEO_MODE_NTSC;
     capchannels = 0;
     currentcapchannel = 0;
+    externalChannels = false;
     
     channelorder = "channum + 0";
 }
@@ -148,7 +149,10 @@
 
     if (pParent->CheckChannel(this, chan, finetune))
     {
-        if (GetCurrentInput() == "Television")
+        if (UseExternalChannels() &&
+        !pParent->ChangeExternalChannel(chan))
+            return false;
+        else if (GetCurrentInput() == "Television")
         {
             int i = GetCurrentChannelNum(chan);
             if (i == -1)
@@ -157,21 +161,11 @@
             int frequency = curList[i].freq * 16 / 1000 + finetune;
             if (ioctl(videofd, VIDIOCSFREQ, &frequency) == -1)
                 perror("channel set:");
-
-            curchannelname = chan;
-
-            pParent->SetVideoFiltersForChannel(this, chan);
-	    return true;
         }
-        else
-        {
-            if (pParent->ChangeExternalChannel(chan))
-            {
+
                 curchannelname = chan;
                 pParent->SetVideoFiltersForChannel(this, chan);
                 return true;
-            }
-        }
     }
 
     return false;
Index: MC/libs/libmythtv/channel.h
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/channel.h,v
retrieving revision 1.15
diff -d -u -w -r1.15 channel.h
--- MC/libs/libmythtv/channel.h	3 Mar 2003 04:54:53 -0000	1.15
+++ MC/libs/libmythtv/channel.h	6 Mar 2003 02:57:46 -0000
@@ -26,6 +26,9 @@
     bool SetChannelByString(const QString &chan); 
     bool ChannelUp(void);
     bool ChannelDown(void);
+    bool UseExternalChannels(bool set) { externalChannels = set;
+                                         return externalChannels; }
+    bool UseExternalChannels(void) {     return externalChannels; }
     bool NextFavorite(void);
 
     int ChangeColour(bool up);
@@ -63,6 +66,7 @@
     map<int, QString> channelnames;
 
     QString channelorder;
+    bool externalChannels;
 };
 
 #endif
Index: MC/libs/libmythtv/tv_rec.cpp
===================================================================
RCS file: /var/lib/cvs/MC/libs/libmythtv/tv_rec.cpp,v
retrieving revision 1.42
diff -d -u -w -r1.42 tv_rec.cpp
--- MC/libs/libmythtv/tv_rec.cpp	4 Mar 2003 02:33:44 -0000	1.42
+++ MC/libs/libmythtv/tv_rec.cpp	6 Mar 2003 02:57:49 -0000
@@ -59,6 +59,8 @@
     channel->SetFreqTable(gContext->GetSetting("FreqTable"));
     if (inputname != "")
         channel->SwitchToInput(inputname);
+    if ("Television" == inputname)
+        channel->UseExternalChannels(gContext->GetNumSetting("ExternalChannelsForTV", 0));
     channel->SetChannelByString(startchannel);
     channel->SetChannelOrdering(chanorder);
     channel->Close();


More information about the mythtv-dev mailing list