Opened 18 years ago
Closed 18 years ago
#1683 closed patch (fixed)
Scan can fail to add channels because new chanid collides with existing chanid
Reported by: | Owned by: | danielk | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
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.
Attachments (1)
Change History (2)
Changed 18 years ago by
Attachment: | CreateChanID.patch added |
---|
comment:1 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch to avoid generating a new chanid that conflicts with an existing chanid