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).
This commit is contained in:
schmirl 2006-11-24 11:45:36 +00:00
parent 11f4a0c6e1
commit 7c300e2a12
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}