[mythtv-commits] Ticket #109: DVB/ATSC patch to allow configuring channels via channels.conf

MythTV mythtv at cvs.mythtv.org
Thu Jul 14 20:17:57 EDT 2005


#109: DVB/ATSC patch to allow configuring channels via channels.conf
--------------------+-------------------------------------------------------
       Id:  109     |      Status:  new                     
Component:  mythtv  |    Modified:  Fri Jul 15 00:17:56 2005
 Severity:  medium  |   Milestone:  0.19                    
 Priority:  minor   |     Version:  head                    
    Owner:  ijr     |    Reporter:  mythtv.lutzer at gmail.com 
--------------------+-------------------------------------------------------
 As per an email thread on mythdev, John Pullan (john.pullan [at] gmail dot
 com) suggested that I submit a patch to get this change committed to svn.

 --- BEGIN EMAIL THREAD ---
 On 21/06/05, Christiaan Lutzer <mythtv.lutzer at gmail.com> wrote:

 <snip>
 - Hide quoted text -

 > Anyway, onto why this message is appropriate for this email list: I
 > had to alter my libmythtv library sources in order to get this to
 > work.  The HD-3000 card is recognized as an ATSC card.  For the life
 > of me I could not get scanning to work, so I had to figure out
 > something else to do.  I noticed that if the card was a QAM (FE_QAM)
 > card, that you could supply a "channels.conf" file in lieu of
 > scanning.  However, with ATSC, the GUI components are not there to
 > allow you to enter a channels.conf file if the card is ATSC.  So, I
 > hacked the code to:
 >
 > 1.) Allow one to specify a channels.conf file if your card is of type
 ATSC, and
 >
 > (scanwizardhelpers.cpp)
 >     case CardUtil::ATSC:
 >         addSelection(tr("Full Scan"),
 >                      QString::number(FullScan_ATSC),true);
 > +       addSelection(tr("Import channels.conf"),
 > +                    QString::number(Import));
 >
 > 2.) Modified the DVBConfParser to read in the program number from
 > channels.conf if the card type is ATSC.
 >
 > (dvbconfparser.cpp)
 > bool DVBConfParser::parseConfATSC(QStringList& tokens)
 > {
 >     cerr << "DVBConfParser::parseConfATSC(): parsing tokens..." << endl;
 >
 >     Channel c;
 >     QStringList::Iterator i = tokens.begin();
 >     QStringList::Iterator end = tokens.end();
 >     if (i != end) c.name = *i++; else return false;
 >     if (i != end) c.frequency = (*i++).toInt(); else return false;
 >     if (i == end || !c.modulation.parseConf(*i++)) return false;
 > +   // We need the program number in the transport stream, otherwise we
 cannot
 > +   // "tune" to the program.
 > +   if (i != end) c.serviceid = (*i++).toInt(); else return false;
 >
 >     channels.append(c);
 >
 >     return true;
 > }
 >
 > And, the channels.conf file that I used simply looked like:
 > [root at localhost ~]# cat channels.conf
 > PBS HDTV:585000000:QAM_256:1
 > CBS HDTV:603000000:QAM_256:2
 > ABC HDTV:597000000:QAM_256:1
 > NBC HDTV:597000000:QAM_256:2
 > FOX HDTV:603000000:QAM_256:1
 > TNT HDTV:681000000:QAM_256:1
 > GBH Kids DTV:591000000:QAM_256:2
 >

 The above looks fine, although I have no way to test this, I suggest
 you submit a patch :)

 > Now, to me, if you want to use MythTV to record and view HD and SD
 > Digital TV, it would be very difficult programmatically to determine
 > what frequency and program number corresponded to what XMLTV ID.  So,
 > to me anyway, channels.conf seems like the way to go.
 >
 > Does this hack make sense?  Is there a better way to do it?  Am I nuts?
 >
 If we are going to have an import channels.conf it make sense to have
 it for all types.

 Later.
 --
 John
 --- END EMAIL THREAD ---


 I created an svn diff patch file (are you supposed to paste the contents
 of it inline?)  I have the patch available here as well:

 http://mandalore.dyndns.biz/~clutzer/mythtv/channels.conf_patch_for_DVB-
 ATSC.patch

 --- BEGIN SVN DIFF PATCH ---
 Index: libs/libmythtv/scanwizardhelpers.cpp
 ===================================================================
 --- libs/libmythtv/scanwizardhelpers.cpp        (revision 6793)
 +++ libs/libmythtv/scanwizardhelpers.cpp        (working copy)
 @@ -264,6 +264,8 @@
      case CardUtil::ATSC:
          addSelection(tr("Full Scan"),
                       QString::number(FullScan_ATSC),true);
 +        addSelection(tr("Import channels.conf"),
 +                     QString::number(Import));
          break;
      case CardUtil::ERROR_PROBE:
          addSelection(QObject::tr("Failed to probe the card"),
 Index: libs/libmythtv/dvbconfparser.cpp
 ===================================================================
 --- libs/libmythtv/dvbconfparser.cpp    (revision 6793)
 +++ libs/libmythtv/dvbconfparser.cpp    (working copy)
 @@ -154,6 +154,9 @@
      if (i != end) c.name = *i++; else return false;
      if (i != end) c.frequency = (*i++).toInt(); else return false;
      if (i == end || !c.modulation.parseConf(*i++)) return false;
 +    // We need the program number in the transport stream, otherwise we
 cannot
 +    // "tune" to the program.
 +    if (i != end) c.serviceid = (*i++).toInt(); else return false;

      channels.append(c);

 --- END SVN DIFF PATCH ---

-- 
Ticket URL: <http://cvs.mythtv.org/trac/ticket/109>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list