[mythtv] [mythtv-commits] mythtv commit: r11390 by danielk

Michael T. Dean mtdean at thirdcontact.com
Tue Oct 3 02:30:54 UTC 2006


On 10/02/06 19:28, mythtv at cvs.mythtv.org wrote:

>      Author: danielk
>        Date: 2006-10-02 23:28:18 +0000 (Mon, 02 Oct 2006)
>New Revision: 11390
>   Changeset: http://cvs.mythtv.org/trac/changeset/11390
>
>Modified:
>
>   trunk/mythtv/libs/libmythtv/frequencies.c
>
>Log:
>
>Refs #2087. Finetunes Cable HRC table.
>
>Our HRC table entries are a few kHz off. This corrects for that with a patch from mtdean at thirdcontact com.
>
>Generally the lower channels were within the rounding error of the bttv and ivtv drivers, but the error accumulates so that at 125 it is three bttv/ivtv finetune ticks from the correct value. If you are using HRC and are not finetuning the upper channels this should improve your analog reception a bit. If you were finetuning, you should clear for your HRC channels.
>

So, the entire time you were away, Daniel, I couldn't figure out a good 
way to do a dbcheck update for the finetuning.  When I saw this commit, 
I started to write a message asking if this means I don't have to do the 
update and started describing what makes it so ugly.  Then, of course 
(since I was saying why it can't be done nicely), I figured out a pretty 
nice way of doing it (at least the WHERE part of it--others might have a 
better idea for the list of 40 SQL statements it requires).  Seems the 
2nd left join never crossed my mind until now.

The SELECT below shows how the WHERE works.  So, I'd just need to change 
it to an UPDATE and come up with the appropriate list of UPDATE 
statements.  ...  Well, as long as I've gone this far, I guess I could 
just attach the actual (untested!) UPDATES...  I didn't provide a patch 
because I don't know if you want this as 2 separate patches (one HRC and 
one IRC) and/or 2 separate DB version updates.

The attached file, hrc-finetune-updates, shows the list of changes to 
the frequencies and provides some skeleton pseudo-code that could 
relatively-easily be integrated into dbcheck.cpp (either by executing 
the SQL itself as in update 1094 or by dynamically creating an updates[] 
for performActualUpdate()).  The irc-finetune-updates is just two SQL 
statements that should both be executed (so it will be much more like a 
"normal" update).

I included an "AND freqid < 10000" (which we use to tell if it's a 
channel number or a frequency) in the SELECT since the finetune is not 
used if the user specifies a frequency.  For IRC, the "initial" 
decrement is done on all non-zero finetune values in that same range, so 
if the user had any channels with freqid > 125, they will be 
incremented.  But, since the frequency table does not currently have any 
channels over 126, it would be impossible for the user to specify these 
channels by channel number--they must use frequency--so finetune will be 
ignored.  However, if they had a value in there (whatever it meant to 
them), it will be modified.

Mike

SELECT freqtable, data as defaultfreqtable, freqid, finetune
  FROM channel
  LEFT JOIN videosource ON channel.sourceid = videosource.sourceid
  LEFT JOIN settings ON value = 'FreqTable'
 WHERE (
         (
           freqtable = 'us-cable-hrc'
           OR
           (
             freqtable = 'default'
             AND
             data = 'us-cable-hrc'
           )
         )
         AND finetune != 0
         AND freqid < 10000
       );




-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: hrc-finetune-updates
Url: http://mythtv.org/pipermail/mythtv-dev/attachments/20061002/38e36354/attachment.diff 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: irc-finetune-updates
Url: http://mythtv.org/pipermail/mythtv-dev/attachments/20061002/38e36354/attachment-0001.diff 


More information about the mythtv-dev mailing list