Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1803 closed defect (fixed)

Configuring number of channels causes channel names to be missaligned with program information.

Reported by: anonymous Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: 0.19
Severity: medium Keywords:
Cc: dscoular@… Ticket locked: no

Description

If I change the configuration of the guide to show six channels rather than the default five, the channel names/icons no longer line up with the program information. See attached screenshots for before and after.

Attachments (4)

Screenshot-mythfrontend-broken.jpg (42.7 KB) - added by lyricnz@… 18 years ago.
Screenshot of program guide with missaligned channels/programs
Screenshot-mythfrontend-ok.jpg (42.5 KB) - added by lyricnz@… 18 years ago.
Screenshot of program guide with missaligned channels/programs
good.patch (1.2 KB) - added by lyricnz@… 18 years ago.
Screenshot-mythfrontend.jpg (52.4 KB) - added by lyricnz@… 18 years ago.
Screenshot of guide after applying good.patch

Download all attachments as: .zip

Change History (11)

Changed 18 years ago by lyricnz@…

Screenshot of program guide with missaligned channels/programs

Changed 18 years ago by lyricnz@…

Screenshot of program guide with missaligned channels/programs

comment:1 Changed 18 years ago by anonymous

This may be an off-by-one error : my configuration actually has SIX channels configured.

http://svn.mythtv.org/trac/browser/trunk/mythtv/libs/libmythtv/guidegrid.cpp#L247 247 maxchannel = max((int)m_channelInfos.size() - 1, 0); 248 setStartChannel((int)(m_currentStartChannel) - 249 (int)(desiredDisplayChans / 2)); 250 if (DISPLAY_CHANS > maxchannel) 251 DISPLAY_CHANS = maxchannel

maxchannel look like a zero-based index, and DISPLAY_CHANS is a one-based number. Surely the "if" clause is off-by-one?

comment:2 Changed 18 years ago by anonymous

(Repost of previous comment with proper formatting. Sorry)

This may be an off-by-one error : my configuration actually has SIX channels configured.

http://svn.mythtv.org/trac/browser/trunk/mythtv/libs/libmythtv/guidegrid.cpp

247 	    maxchannel = max((int)m_channelInfos.size() - 1, 0);
248 	    setStartChannel((int)(m_currentStartChannel) -
249 	                    (int)(desiredDisplayChans / 2));
250 	    if (DISPLAY_CHANS > maxchannel)
251 	        DISPLAY_CHANS = maxchannel;

maxchannel look like a zero-based index, and DISPLAY_CHANS is a one-based number. Surely the "if" clause is off-by-one?

comment:3 Changed 18 years ago by dscoular@…

Cc: dscoular@… added

Hi Llyric, I've verified that this is a bug. I modified line 251 from:

    if (DISPLAY_CHANS > maxchannel)
        DISPLAY_CHANS = maxchannel;

to:

    if (DISPLAY_CHANS > maxchannel + 1) // DUG FIXME
        DISPLAY_CHANS = maxchannel;

And it fixes the issue for me. However, there a number of these exact same if statements through this file and I suspect they should all be changed to the above.

Cheers,

Doug

Changed 18 years ago by lyricnz@…

Attachment: good.patch added

comment:4 Changed 18 years ago by lyricnz@…

Previous attachment is by dscoular@…, and is against 0.19-fixes svn revision 9953.

I am unable to verify this myself right now, as I have other unrelated issues with myth-svn. Will apply this patch to my 0.19 build tonight, and see how it goes.

comment:5 Changed 18 years ago by lyricnz@…

Yup, good.patch appears to fix the problem for me, see following screenshot.

Changed 18 years ago by lyricnz@…

Attachment: Screenshot-mythfrontend.jpg added

Screenshot of guide after applying good.patch

comment:6 Changed 18 years ago by Isaac Richards

Resolution: fixed
Status: newclosed

Fixed in [10026].

comment:7 Changed 18 years ago by lyricnz@…

Please apply this fix to 0.19-fixes. Thanks!

Note: See TracTickets for help on using tickets.