Opened 15 years ago

Closed 15 years ago

#5830 closed patch (fixed)

TV Guide StartChannel logic error

Reported by: wstewart@… Owned by: danielk
Priority: minor Milestone: 0.22
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

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.

Change History (3)

comment:1 Changed 15 years ago by wstewart@…

By the way, the proposed code above I have tested with SVN and it is working fine. I can add a patch for the above code if needed, if this solution method is acceptable.

comment:2 Changed 15 years ago by danielk

Milestone: unknown0.22
Owner: changed from Isaac Richards to danielk
Status: newaccepted
Type: defectpatch
Version: unknownhead

comment:3 Changed 15 years ago by danielk

Resolution: fixed
Status: acceptedclosed

(In [19071]) Fixes #5830. Start on first channel when we can't find the current channel in the lineup. Functionally this is really for #199, but was a bug in it's own right.

Note: See TracTickets for help on using tickets.