From 7c300e2a12d11a046b8a0d86c4c0f2e37a2950b1 Mon Sep 17 00:00:00 2001 From: schmirl Date: Fri, 24 Nov 2006 11:45:36 +0000 Subject: [PATCH] Cache translation in cPluginStreamdevServer::Active() as this method may be called very often. Though tr() is not producing too much overhead it is not neglectible either. If the actual translation is missing, the resulting syslog messages will become annoying. Note that the current OSD language is not monitored. Changes won't be reflected until the next restart. Thanks to Urig for the patch (#197). --- streamdev-server.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/streamdev-server.c b/streamdev-server.c index 823e272..2d81652 100644 --- a/streamdev-server.c +++ b/streamdev-server.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: streamdev-server.c,v 1.3 2006/07/05 20:36:58 thomas Exp $ + * $Id: streamdev-server.c,v 1.4 2006/11/24 11:45:36 schmirl Exp $ */ #include "streamdev-server.h" @@ -59,7 +59,9 @@ cString cPluginStreamdevServer::Active(void) { if (cStreamdevServer::Active()) { - return tr("Streaming active"); + static const char *Message = NULL; + if (!Message) Message = tr("Streaming active"); + return Message; } return NULL; }