Opened 18 years ago

Closed 18 years ago

#1586 closed patch (fixed)

LCD::Get() creates LCD object, even when disabled

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

Description

While debugging something entirely unrelated I noticed that calls to LCD::Get() were returning non-NULL even though I have the LCD stuff disabled in my settings. As a result anybody using LCD::Get() to determing whether they should do LCD-update stuff was doing the work anyways despite the fact that the results would go unused in the LCD object itself (in my case it was TV::RunTV() making the extra effort).

This patch tracks the global setting better and prevents LCD::Get() from newing LCDs if the LCD is disabled in the settings, regardless of m_server_unavailable.

This works for my purposes, but I don't have a LCD to regression test with so somebody with the hardware should probably test this before it gets committed.

--Jack

Attachments (1)

trunk_9499_lcd.patch (1.6 KB) - added by perveilerj@… 18 years ago.
patch against trunk r9499

Download all attachments as: .zip

Change History (5)

Changed 18 years ago by perveilerj@…

Attachment: trunk_9499_lcd.patch added

patch against trunk r9499

comment:1 Changed 18 years ago by Isaac Richards

Resolution: invalid
Status: newclosed

Patch looks to just disable the LCD class completely, as the new 'enabled' variable wouldn't ever get set to true.

comment:2 Changed 18 years ago by perveilerj@…

I admittedly don't know much about the LCD code, but it was my impression that to use the LCD class you had to first call LCD::Setup() (at least this is what mythfrontend does in main() ). In the patch m_enabled is set in LCD::Setup():

m_enabled  = gContext->GetNumSetting("LCDEnable", 0) != 0;

I also set m_enabled in LCD::connectToHost():

m_enabled  = gContext->GetNumSetting("LCDEnable", 0) != 0;

If calling LCD::Setup() isn't a requirement I'd think that calling LCD::connectToHost() would be and then m_enabled would be set there.

Or maybe I'm missing something entirely more obvious? Sorry if that's the case...

comment:3 Changed 18 years ago by Isaac Richards

Resolution: invalid
Status: closedreopened

Yup, you're right, my apologies.

comment:4 Changed 18 years ago by Isaac Richards

Resolution: fixed
Status: reopenedclosed

(In [9585]) Code to not create an LCD object when it's not needed. Bumps libmyth abi version.

Closes #1586.

Note: See TracTickets for help on using tickets.