[mythtv-commits] Ticket #5830: TV Guide StartChannel logic error
MythTV
mythtv at cvs.mythtv.org
Thu Oct 16 17:57:29 UTC 2008
#5830: TV Guide StartChannel logic error
---------------------------------+------------------------------------------
Reporter: wstewart at hgrace.com | Owner: ijr
Type: defect | Status: new
Priority: minor | Milestone: unknown
Component: mythtv | Version: unknown
Severity: low | Mlocked: 0
---------------------------------+------------------------------------------
There is a logic error in the code to determine the startchannel in
guidegrid.cpp introduced sometime in the last few months.
In the routine GuideGrid::fillChannelInfos there is the following code:
if (gotostartchannel)
m_currentStartChannel = FindChannel(startChanID, startChanNum);
m_currentStartChannel = max((uint)0, m_currentStartChannel);
FindChannel returns -1 if it is unable to match the startChanID with a
channel and the max function is intended to make m_currentStartChannel=0
in this case. However, m_currentStartChannel is uint, so it never gets
assigned -1, but instead the maximum int value. As such the "max"
function picks this instead of 0 for the startchannel. This causes
GuideGrid::fillProgramRowInfos to return before updating the program
information.
The code should be something like
int ch;
if (gotostartchannel)
ch = FindChannel(startChanID, startChanNum);
m_currentStartChannel = max(0, ch);
This bug affects the channel group patch attached to Ticket #199 for which
I will attached an update for SVN in the next day or so. Without this
patch, when switching channel groups, the guide display doesn`t update for
the newly selected group until one presses pageup or pagedown.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/5830>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list