summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2021-02-03 11:58:00 +0100
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2021-02-03 11:58:00 +0100
commit6aeaf41467f48ff077ca83b8383f31140670250b (patch)
treecd825fdf58eea4ad3ff623feb5708efa1372d23c
parent83c85870fbbce0fe18f226a865e77f47613c30ac (diff)
parentb044321b1f7626aab43b9297c8d594c8f1749ca6 (diff)
downloadvdr-plugin-skindesigner-6aeaf41467f48ff077ca83b8383f31140670250b.tar.gz
vdr-plugin-skindesigner-6aeaf41467f48ff077ca83b8383f31140670250b.tar.bz2
Merge branch 'pbiering/skindesigner-fix-busy-svdrpresult'
-rw-r--r--HISTORY2
-rw-r--r--designer.c9
-rw-r--r--designer.h4
-rw-r--r--extensions/imageloader.c4
-rw-r--r--skindesigner.c23
5 files changed, 34 insertions, 8 deletions
diff --git a/HISTORY b/HISTORY
index 5b33437..c849765 100644
--- a/HISTORY
+++ b/HISTORY
@@ -471,3 +471,5 @@ Version 1.2.10
Version 1.2.10+
- [pbiering] align displayed tuner number (0,1,2 -> 1,2,3)
+- [pbiering] SVDRP: do not reload in case plugin is not fully initialized (results in VDR crash)
+- [pbiering] SVDRP: respond with proper error message in case of OSD is active or parsing error
diff --git a/designer.c b/designer.c
index c0dd20a..974a5ef 100644
--- a/designer.c
+++ b/designer.c
@@ -3,6 +3,7 @@
cSkinDesigner::cSkinDesigner(string skin, cTheme *theme) : cSkin(skin.c_str(), theme) {
init = true;
+ initialized = false;
this->skin = skin;
backupSkin = NULL;
@@ -106,11 +107,11 @@ cSkinDisplayMessage *cSkinDesigner::DisplayMessage(void) {
return displayMessage;
}
-void cSkinDesigner::Reload(void) {
+int cSkinDesigner::Reload(void) {
dsyslog("skindesigner: forcing full reload of templates");
if (cOsd::IsOpen()) {
esyslog("skindesigner: OSD is open, close first!");
- return;
+ return 2;
}
cStopWatch watch;
@@ -120,11 +121,13 @@ void cSkinDesigner::Reload(void) {
if (!backupSkin)
backupSkin = new cSkinLCARS();
useBackupSkin = true;
+ return 1;
} else {
CacheViews();
useBackupSkin = false;
watch.Stop("templates reloaded and cache created");
}
+ return 0;
}
void cSkinDesigner::ListAvailableFonts(void) {
@@ -213,11 +216,13 @@ void cSkinDesigner::Init(void) {
esyslog("skindesigner: error during loading of templates - using LCARS as backup");
backupSkin = new cSkinLCARS();
useBackupSkin = true;
+ initialized = true;
} else {
CacheViews();
watch.Stop("templates loaded and caches created");
}
init = false;
+ initialized = true;
}
else if (config.OsdFontsChanged())
{
diff --git a/designer.h b/designer.h
index 8870392..c58c974 100644
--- a/designer.h
+++ b/designer.h
@@ -22,6 +22,7 @@ class cSkinDesigner;
class cSkinDesigner : public cSkin {
private:
bool init;
+ bool initialized;
string skin;
cSkinLCARS *backupSkin;
bool useBackupSkin;
@@ -51,7 +52,8 @@ public:
virtual cSkinDisplayTracks *DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks);
virtual cSkinDisplayMessage *DisplayMessage(void);
void ActivateBackupSkin(void) { useBackupSkin = true; };
- void Reload(void);
+ int Reload(void);
+ bool Initialized(void) { return initialized; };
void ListAvailableFonts(void);
bool SetCustomIntToken(string option);
bool SetCustomStringToken(string option);
diff --git a/extensions/imageloader.c b/extensions/imageloader.c
index bd2d268..88ecb14 100644
--- a/extensions/imageloader.c
+++ b/extensions/imageloader.c
@@ -178,14 +178,14 @@ cImageImporterSVG::cImageImporterSVG() {
cImageImporterSVG::~cImageImporterSVG() {
if (handle) {
- rsvg_handle_close(handle, NULL);
+ rsvg_handle_close(handle, NULL); // deprecated since version 2.46
g_object_unref(handle);
}
}
bool cImageImporterSVG::LoadImage(const char *path) {
if (handle) {
- rsvg_handle_close(handle, NULL);
+ rsvg_handle_close(handle, NULL); // deprecated since version 2.46
g_object_unref(handle);
}
diff --git a/skindesigner.c b/skindesigner.c
index c3f3e66..71eb363 100644
--- a/skindesigner.c
+++ b/skindesigner.c
@@ -241,6 +241,7 @@ cString cPluginSkinDesigner::SVDRPCommand(const char *Command, const char *Optio
cSkinDesigner *activeSkin = NULL;
cSkinDesigner *availableSkin = NULL;
config.InitSkinRefsIterator();
+ int result = 0;
while (availableSkin = config.GetNextSkinRef()) {
string activeSkinName = Setup.OSDSkin;
string currentSkinName = availableSkin->Description();
@@ -256,6 +257,10 @@ cString cPluginSkinDesigner::SVDRPCommand(const char *Command, const char *Optio
}
if (strcasecmp(Command, "RELD") == 0) {
+ if (!activeSkin->Initialized()) {
+ ReplyCode = 503;
+ return "SKINDESIGNER reload of templates and caches failed: initialization not finished.";
+ }
config.ClearSkinSetups();
config.InitSkinIterator();
string skin = "";
@@ -264,9 +269,21 @@ cString cPluginSkinDesigner::SVDRPCommand(const char *Command, const char *Optio
}
config.TranslateSetup();
config.SetSkinSetupParameters();
- activeSkin->Reload();
- ReplyCode = 250;
- return "SKINDESIGNER reload of templates and caches forced.";
+ result = activeSkin->Reload();
+ switch (result) {
+ case 0:
+ ReplyCode = 250;
+ return "SKINDESIGNER reload of templates and caches forced.";
+ case 1:
+ ReplyCode = 501;
+ return "SKINDESIGNER reload of templates and caches failed: error during loading - using LCARS as backup.";
+ case 2:
+ ReplyCode = 503;
+ return "SKINDESIGNER reload of templates and caches failed: OSD is open, close first.";
+ default:
+ ReplyCode = 500;
+ return "SKINDESIGNER reload of templates and caches failed: unknown reason (check code).";
+ };
} else if (strcasecmp(Command, "DLIC") == 0) {
if (imgCache)
delete imgCache;