[mythtv-commits] Ticket #1683: Scan can fail to add channels because new chanid collides with existing chanid

MythTV mythtv at cvs.mythtv.org
Fri Apr 14 14:21:29 UTC 2006


#1683: Scan can fail to add channels because new chanid collides with existing
chanid
------------------------------------------------+---------------------------
 Reporter:  Paul Milazzo <pgm0203 at comcast.net>  |       Owner:  danielk
     Type:  patch                               |      Status:  new    
 Priority:  minor                               |   Milestone:         
Component:  mythtv                              |     Version:  head   
 Severity:  medium                              |  
------------------------------------------------+---------------------------
 When adding a channel, `ChannelUtil::CreateChanID` synthesizes a new
 `chanid` from the source and channel number, then tests the resulting
 `chanid` to ensure it does not collide with an existing `chanid`. If it
 does, `ChannelUtil::CreateChanID` chooses a new value one larger than the
 largest `chanid` currently assigned to the source in question.

 Unfortunately, this second new `chanid` can (and on my system, does)
 itself collide with an existing `chanid` assigned to a higher-numbered
 source. As a result, the attempt to add the new channel fails without
 notification in the UI. An error message is, fortunately, written to the
 console.

 The attached patch simply checks for the second collision and chooses a
 third value one larger than any current `chanid`. Another solution that
 would result in `chanid` values closer to the original would be to resolve
 the collisions using linear probing, but doing so could be much slower.

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


More information about the mythtv-commits mailing list