[mythtv] Multiple input/card behavior - Coding question.

Steve Davies steve at one47.co.uk
Mon Nov 10 16:54:03 EST 2003


Hi all,

I am currently in a position where I have MythTV working pretty much perfectly 
if I stick to using one input from one card. I do have a DVB card, which is 
mostly working, but I'll cover that in a separate email ;-)

(FYI, I am using ivtv latest as of today, MythTV CVS also as of today.)

Looking at the code (I am no expert) it seems to me that the backend on 
startup builds a list of all cards, local or remote, from the database. For 
each of these it creates a TVRec:: object, and this will create either a 
Channel:: object, or a DVBChannel:: object (One per card) - So far so good...

 From the code, It looks like it assumes that from this point on, "channum" is 
unique across all cards. In my case, several channel numbers appear three 
times, with differnt tuning parameters and details. This assumption comes from 
  Channel::SetChannelByString(QString &chan) - It queries the channel table by 
channel number, but has no idea whatsoever at this point which "sourceid" it 
is viewing, so often gets the wrong, or no frequency from the table.

My first thought was to add a private "sourceid" member to the Channel class, 
and add it to the constructor. Channel is only ever created by TVRec, so this 
seemed sensible. Then I moved on up to looking at TVRec - Could I get hold of 
sourceid easily?

Unfortunately, I could not see how this could be done. The TVRec::GetDevices 
call gets getails of the current cardid, but the input (and hence the 
sourceid) is chosen using the DefaultInput for the card, rather than using the 
currently selected card-input.

I cannot in fact see where the code refers to the current input at any time.

To make matters worse, I have actually got 3 different sources, ALL of which 
serve channel numbers "1" thru "5", using 10 different frequencies, and an 
IRblaster. Originally, I created a single source, and connected it to all 3 
inputs, which only caused even more pain :-)

I may of course be talking out of my rear-end, but if someone could comment, I 
would be most appreciative, and more than happy to try and go further with 
improving the code in this area. It is possible to 'c' between inputs on a 
card, so I assume I am missing SOMETHING :-(

Kind regards,
Steve
-- 
Steve Davies                   steve at one47.co.uk

PGP Fingerprints:
DH/DSS : 5D85 8164 91D7 E9CC 4F80  842B AB86 93D9 8938 7612
RSA    :      4E2E E60F 3D76 9E7E  70F9 901B 70FA 56C8
RSA4096: 02BE 5C0E EFA2 E1E4 EA89  C9CC 1E4F F654 3BC7 B65E



More information about the mythtv-dev mailing list