summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2020-12-11 18:14:16 +0100
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2020-12-11 18:49:26 +0100
commitbc9cb23ed73c7b85210c8948135773b973fc2927 (patch)
tree4fe25dbbcf490865ffe58c625399fbe2b29c3c4b
parentdf8c8e299363a5e93c1436cf8d8ca54c57694256 (diff)
downloadvdr-plugin-skindesigner-1.2.8.6.tar.gz
vdr-plugin-skindesigner-1.2.8.6.tar.bz2
Refresh imgCache if OsdProvider was changed (Thanks to lnj @vdr-portal.de)1.2.8.6
-rw-r--r--config.c10
-rw-r--r--config.h2
-rw-r--r--designer.c11
-rw-r--r--skindesigner.c18
4 files changed, 39 insertions, 2 deletions
diff --git a/config.c b/config.c
index af8661b..3521615 100644
--- a/config.c
+++ b/config.c
@@ -462,6 +462,16 @@ bool cDesignerConfig::OsdSizeChanged(void) {
return false;
}
+// If softhddevice is suspended, it gives the video size 0x0
+// We use this for detect a play mode change and drop the cache, because it is corrupted after being suspended
+bool cDesignerConfig::PlayModeChanged(void) {
+ if (mode_changed) {
+ mode_changed = 0;
+ return true;
+ }
+ return false;
+}
+
void cDesignerConfig::SetOSDFonts(void) {
fontFix = Setup.FontFix;
fontOsd = Setup.FontOsd;
diff --git a/config.h b/config.h
index 50860de..cffab3f 100644
--- a/config.h
+++ b/config.h
@@ -92,6 +92,7 @@ public:
bool SkinChanged(void);
void SetOSDSize(void);
bool OsdSizeChanged(void);
+ bool PlayModeChanged(void);
void SetOSDFonts(void);
bool OsdFontsChanged(void);
void SetOsdLanguage(void) { osdLanguage = Setup.OSDLanguage; };
@@ -118,6 +119,7 @@ public:
int FPS;
//TemplateReload on Setup Close
bool setupCloseDoReload;
+ int mode_changed;
};
#ifdef DEFINE_CONFIG
diff --git a/designer.c b/designer.c
index b6f35b1..c0dd20a 100644
--- a/designer.c
+++ b/designer.c
@@ -171,6 +171,7 @@ void cSkinDesigner::ListCustomTokens(void) {
}
skindesignerapi::ISkinDisplayPlugin *cSkinDesigner::GetDisplayPlugin(int plugId) {
+ Init();
map<int, cViewPlugin*>::iterator hit = pluginViews.find(plugId);
if (hit == pluginViews.end())
return NULL;
@@ -194,7 +195,7 @@ void cSkinDesigner::Init(void) {
config.SetOSDFonts();
}
dsyslog("skindesigner: initializing skin %s", skin.c_str());
-
+
config.CheckDecimalPoint();
plgManager->Reset();
@@ -235,6 +236,14 @@ void cSkinDesigner::Init(void) {
watch.Stop("templates loaded and caches created");
}
}
+ else if (config.PlayModeChanged())
+ {
+ dsyslog ("skindesigner: drop image cache");
+ if (imgCache)
+ delete imgCache;
+ imgCache = new cImageCache();
+ imgCache->SetPathes();
+ }
}
void cSkinDesigner::DeleteViews(void) {
diff --git a/skindesigner.c b/skindesigner.c
index f88c074..0f9889a 100644
--- a/skindesigner.c
+++ b/skindesigner.c
@@ -7,6 +7,7 @@
*/
#include <getopt.h>
#include <vdr/plugin.h>
+#include <vdr/device.h>
#define DEFINE_CONFIG 1
#include "config.h"
@@ -20,7 +21,7 @@
#endif
-static const char *VERSION = "1.2.8.4";
+static const char *VERSION = "1.2.8.6";
static const char *DESCRIPTION = trNOOP("Skin Designer");
class cPluginSkinDesigner : public cPlugin, public skindesignerapi::SkindesignerAPI {
@@ -175,6 +176,21 @@ void cPluginSkinDesigner::Housekeeping(void) {
}
void cPluginSkinDesigner::MainThreadHook(void) {
+ int w, h;
+ double a;
+ static int mode;
+ cDevice::PrimaryDevice()->GetVideoSize(w, h, a);
+
+ if (!w && !h && !mode) {
+ mode = 1;
+ config.mode_changed = 1;
+ dsyslog("skindesigner: w %d h %d mode changed to %d\n", w, h, mode);
+ }
+ else if (w && h && mode) {
+ mode = 0;
+ config.mode_changed = 1;
+ dsyslog("skindesigner: w %d h %d mode changed to %d\n", w, h, mode);
+ }
}
cString cPluginSkinDesigner::Active(void) {