Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: No osd available in Plugins-Start()



Klaus Schmidinger wrote:
Achim Tuffentsammer wrote:

Hello

just a minor issue.
When the remote-plugins fails to open its input devices
(in its Start() method) it tries to display an error message
on the OSD. This crashes vdr since at this point there's no osd
or skin available:
...
Well, the description is from a time before there were skins.
Now we're facing a chicken-and-egg situation, because plugins
can implement skins, so before the plugins have been started,
there are no skins, yet (except for the default skins, which could
already be there, but that's probably not what a user who has
a skin that's implemented by a plugin wants).

So I guess the fix will be to create the default skins before
starting the plugins, have every skin set itself as the "current"
skin (so if the skin plugin is loaded before the remote plugin,
the error message will be given using the correct skin) and
calling Skins.SetCurrent() and cThemes::Load() after the plugins
have been started.

Klaus
Here's a patch that tries to fix this (not tested).

Please give it a try.

Klaus
--- vdr.c	2005/01/06 14:36:40	1.198
+++ vdr.c	2005/01/09 16:35:36
@@ -460,15 +460,20 @@
 
   Interface = new cInterface(SVDRPport);
 
+  // Default skins:
+
+  new cSkinClassic;
+  new cSkinSTTNG;
+  Skins.SetCurrent(Setup.OSDSkin);
+  cThemes::Load(Skins.Current()->Name(), Setup.OSDTheme, Skins.Current()->Theme());
+
   // Start plugins:
 
   if (!PluginManager.StartPlugins())
      EXIT(2);
 
-  // Skins:
+  // Set skin and theme in case they're implemented by a plugin:
 
-  new cSkinClassic;
-  new cSkinSTTNG;
   Skins.SetCurrent(Setup.OSDSkin);
   cThemes::Load(Skins.Current()->Name(), Setup.OSDTheme, Skins.Current()->Theme());
 
--- skins.c	2004/11/07 09:46:46	1.3
+++ skins.c	2005/01/09 16:37:24
@@ -130,6 +130,7 @@
   if (theme)
      cThemes::Save(name, theme);
   Skins.Add(this);
+  Skins.SetCurrent(Name);
 }
 
 cSkin::~cSkin()

Home | Main Index | Thread Index