From patchwork Wed Nov 15 13:36:44 2006 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Udo Richter X-Patchwork-Id: 12406 Received: from mail.gmx.net ([213.165.64.20]) by www.linuxtv.org with smtp (Exim 4.50) id 1GkKy1-0007UN-QG for vdr@linuxtv.org; Wed, 15 Nov 2006 14:38:17 +0100 Received: (qmail invoked by alias); 15 Nov 2006 13:37:47 -0000 Received: from p57A88F1F.dip0.t-ipconnect.de (EHLO localhost) [87.168.143.31] by mail.gmx.net (mp036) with SMTP; 15 Nov 2006 14:37:47 +0100 X-Authenticated: #1417946 Message-ID: <455B17EC.3080009@gmx.de> Date: Wed, 15 Nov 2006 14:36:44 +0100 From: Udo Richter User-Agent: Thunderbird 2.0b1pre (Windows/20061114) MIME-Version: 1.0 To: vdr-ml@jwendel.de, VDR Mailing List Subject: Re: [vdr] vdr shutdown handling / streamdev plugin References: <200611141003.07963.vdr-ml@jwendel.de> <455A0A71.4030805@gmx.de> <200611150735.48405.vdr-ml@jwendel.de> In-Reply-To: <200611150735.48405.vdr-ml@jwendel.de> X-Y-GMX-Trusted: 0 X-BeenThere: vdr@linuxtv.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: VDR Mailing List List-Id: VDR Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Nov 2006 13:38:17 -0000 Status: O X-Status: X-Keywords: X-UID: 11242 Jörg Wendel wrote: >> For plugin developers, I suggest to keep it simple in there. Its >> probably a good idea to tr() the string just once and cache it afterwards. > > this would be a nice change in the streamdev plugin. The attached patch does it. This patch has one side effect: The message wont be re-translated if the selected VDR OSD language is changed, you have to restart to see language changes. Cheers, Udo --- streamdev-server.c.bak 2006-11-15 14:29:20.000000000 +0100 +++ streamdev-server.c 2006-11-15 14:30:51.000000000 +0100 @@ -59,7 +59,9 @@ { if (cStreamdevServer::Active()) { - return tr("Streaming active"); + static const char *Message = NULL; + if (!Message) Message = tr("Streaming active"); + return Message; } return NULL; }