From patchwork Fri Mar 25 18:52:25 2005 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Fritz X-Patchwork-Id: 11821 Received: from mout0.freenet.de ([194.97.50.131]) by www.linuxtv.org with esmtp (Exim 4.34) id 1DEtvo-0004XH-TT for vdr@linuxtv.org; Fri, 25 Mar 2005 19:53:16 +0100 Received: from [194.97.55.191] (helo=mx7.freenet.de) by mout0.freenet.de with esmtpa (Exim 4.51) id 1DEtvq-0002mH-S5 for vdr@linuxtv.org; Fri, 25 Mar 2005 19:53:18 +0100 Received: from pd9572896.dip0.t-ipconnect.de ([217.87.40.150] helo=gurke.wofritz.de) by mx7.freenet.de with esmtpa (ID wofritz@freenet.de) (Exim 4.43 #13) id 1DEtvq-0005Jh-Go for vdr@linuxtv.org; Fri, 25 Mar 2005 19:53:18 +0100 Received: from localhost (localhost [127.0.0.1]) by gurke.wofritz.de (Postfix) with ESMTP id CC92C279DA for ; Fri, 25 Mar 2005 19:53:20 +0100 (CET) Received: by gurke.wofritz.de (Postfix, from userid 500) id 33D882C50B; Fri, 25 Mar 2005 19:52:21 +0100 (CET) To: vdr@linuxtv.org X-Original-To: moderator@gurke.wofritz.de Delivered-To: moderator@gurke.wofritz.de by gurke.wofritz.de (Postfix) with ESMTP id BF4EA279DA for ; Fri, 25 Mar 2005 19:52:20 +0100 (CET) id B810B2C50B; Fri, 25 Mar 2005 19:52:19 +0100 (CET) From: Wolfgang Fritz Date: Fri, 25 Mar 2005 19:52:25 +0100 Organization: None Lines: 74 Message-ID: NNTP-Posting-Host: eddie.wofritz.de Mime-Version: 1.0 User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en X-AntiVirus: checked by AntiVir MailGate (version: 2.0.2-8; AVE: 6.30.0.7; VDF: 6.30.0.47; host: gurke) Subject: [vdr] [BUG with PATCH] graphlcd-0.1.2-pre5 does not show channel info after startup X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Wolfgang Fritz , Klaus Schmidinger's VDR List-Id: Klaus Schmidinger's VDR List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2005 18:53:17 -0000 Status: O X-Status: X-Keywords: X-UID: 1096 On my VDR (1.3.23), the graphlcd plugin does not show the channel name and logo after startup. When switching to another channel, name and logo are displayed correctly. Reason: graphlcd's display thread is not yet active when VDR calls the SetChannel() methods of all cStatus objects. Because graphlcd creates its cStatus object (cGraphLCDState) in the display thread, it misses the first SetChannel. Fix: 1. Move the plugin initialization from Start() to Initialize(). This makes it quite sure that the display thread is running at the first SetChannel. 2. In Start(), wait until the display thread is really active. On my system I have never seen a real wait here, but who knows... Patch is attached. Testers and feedback welcome. Wolfgang Index: plugin.c =================================================================== --- plugin.c (Revision 268) +++ plugin.c (Revision 269) @@ -162,11 +162,6 @@ bool cPluginGraphLCD::Initialize() { - return true; -} - -bool cPluginGraphLCD::Start() -{ const char * cfgDir; RegisterI18n(Phrases); @@ -181,6 +176,21 @@ return true; } +bool cPluginGraphLCD::Start() +{ + int count; + dsyslog ("graphlcd: waiting for display thread to get ready"); + for (count = 0; count < 50; count++) { + if (Display.Active()) { + dsyslog ("graphlcd: display thread ready"); + return true; + } + cCondWait::SleepMs(100); + } + dsyslog ("graphlcd: timeout while waiting for display thread"); + return false; +} + void cPluginGraphLCD::Housekeeping() { }