[mythtv] Channel changing Bugs...

Chris Palmer mythtv at zencow.com
Wed Apr 9 16:56:32 EDT 2003

jasonmiller wrote
> Ahh, ok, I missed the sourceid*1000 part of the chanid equation.  
> One backward combatible solution would be to do a string concatenation 
> of the id and sprintf(tmp, "%03d", channum) instead of adding.  
> That would yield unique chanids and, for the simple case the chanid's 
> would match the old method.  You only start running into trouble if 
> there are more than nine video sources in which case someone is 
> severely overcompensating for something anyway :)

I don't see why a chanid has to be based on a channel number.  It 
should simply be UNIQUE.  I don't change channels based on the 
chanid.  I don't view the program guide based on the chanid.  The 
database can keep things organized using an AUTOINCREMENT field for 
the chanid.  The only additional design overhead is having to query
the db for the last chanid just after you do an insert, so you can 
know the chanid to use for other inserts into other tables.

Then, you wouldn't simply be able to construct a chanid based on the 
known source and channel number...  you'd actually have to query the
database to get the chanid, but that's ok.  source and channel number
should be an indexed key pair, making the queries fast.

> -----Original Message-----
> From: Matt Zimmerman [mailto:mdz at debian.org]
> Sent: Tuesday, April 08, 2003 10:28 AM
> To: 'Development of mythtv'
> Subject: Re: [mythtv] Channel changing Bugs...
> On Tue, Apr 08, 2003 at 08:08:12AM -0600, jasonmiller wrote:
> > Ahh, very nice :)  But still, the chanid's should still be unique.  I
> > always wondered why you wouldn't just use the channel number as the
> > primary key anyway.  What am I missing?
> Channel numbers are not unique across multiple video sources.
> -- 
>  - mdz
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at snowman.net
> http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-dev
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at snowman.net
> http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-dev

More information about the mythtv-dev mailing list