summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-10-15 18:00:00 +0200
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2006-10-15 18:00:00 +0200
commit9ef312f888aae6167bf210d0d1bb8fcb9b787584 (patch)
tree1989ca4992d851a76d0c9a50df7d5748dea7fc16
parent948c370a29a21ac1fc9531f7e92d99e24734dcf4 (diff)
downloadvdr-patch-lnbsharing-9ef312f888aae6167bf210d0d1bb8fcb9b787584.tar.gz
vdr-patch-lnbsharing-9ef312f888aae6167bf210d0d1bb8fcb9b787584.tar.bz2
Version 1.4.3-2vdr-1.4.3-2
- Fixed clearing an event's Title, ShortText and Description in case the data comes from an external source. - Updated the Hungarian language texts (thanks to Guido Josten). - Fixed a possible crash if cPluginManager::GetPlugin() is called with a NULL pointer (thanks to Petri Hintukainen). - Fixed displaying the error log message in case an unknown plugin was requested in a key macro (thanks to Petri Hintukainen). - Keys from expanded key macros are now put into the front of the key queue to avoid problems if the queue is not empty at that time (based on a patch from Petri Hintukainen). - cKeyMacro now has an explicit counter for the number of keys it contains. - cRemote::PutMacro() now sets a lock while it expands the macro (thanks to Petri Hintukainen). - Fixed handling plugins from cRemote::PutMacro() and cRemote::CallPlugin() (based on a patch from Petri Hintukainen). - Increased the size of the key queue to avoid problems with long key macros.
-rw-r--r--CONTRIBUTORS9
-rw-r--r--HISTORY19
-rw-r--r--config.h8
-rw-r--r--eit.c9
-rw-r--r--i18n.c8
-rw-r--r--keys.c11
-rw-r--r--keys.h7
-rw-r--r--plugin.c4
-rw-r--r--remote.c31
-rw-r--r--remote.h9
-rw-r--r--vdr.c25
11 files changed, 91 insertions, 49 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 6e79bc3..87bbe36 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -1825,6 +1825,15 @@ Petri Hintukainen <Petri.Hintukainen@hut.fi>
file is in the future
for fixing handling video directory updates in case an other process has touched the
.update file after the last NeedsUpdate() check
+ for fixing a possible crash if cPluginManager::GetPlugin() is called with a NULL
+ pointer
+ for fixing displaying the error log message in case an unknown plugin was requested
+ in a key macro
+ for pointing out that keys from expanded key macros should be put into the front of
+ the key queue to avoid problems if the queue is not empty at that time
+ for making cRemote::PutMacro() set a lock while it expands the macro
+ for pointing out that plugins from cRemote::PutMacro() and cRemote::CallPlugin()
+ need to be handled separately
Marcel Schaeben <mts280@gmx.de>
for his "Easy Input" patch
diff --git a/HISTORY b/HISTORY
index c082442..56557da 100644
--- a/HISTORY
+++ b/HISTORY
@@ -4950,3 +4950,22 @@ Video Disk Recorder Revision History
- Fixed handling language codes and descriptions of recorded audio tracks on channels
with multiple tracks where not all of them appear in the event data (reported by
Boguslaw Juza).
+
+2006-10-15: Version 1.4.3-2
+
+- Fixed clearing an event's Title, ShortText and Description in case the data comes
+ from an external source.
+- Updated the Hungarian language texts (thanks to Guido Josten).
+- Fixed a possible crash if cPluginManager::GetPlugin() is called with a NULL
+ pointer (thanks to Petri Hintukainen).
+- Fixed displaying the error log message in case an unknown plugin was requested
+ in a key macro (thanks to Petri Hintukainen).
+- Keys from expanded key macros are now put into the front of the key queue to
+ avoid problems if the queue is not empty at that time (based on a patch from
+ Petri Hintukainen).
+- cKeyMacro now has an explicit counter for the number of keys it contains.
+- cRemote::PutMacro() now sets a lock while it expands the macro (thanks to
+ Petri Hintukainen).
+- Fixed handling plugins from cRemote::PutMacro() and cRemote::CallPlugin()
+ (based on a patch from Petri Hintukainen).
+- Increased the size of the key queue to avoid problems with long key macros.
diff --git a/config.h b/config.h
index bc3ebd6..360be5d 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h 1.272 2006/09/24 10:09:25 kls Exp $
+ * $Id: config.h 1.274 2006/10/14 10:28:38 kls Exp $
*/
#ifndef __CONFIG_H
@@ -21,13 +21,13 @@
// VDR's own version number:
-#define VDRVERSION "1.4.3-1"
+#define VDRVERSION "1.4.3-2"
#define VDRVERSNUM 10403 // Version * 10000 + Major * 100 + Minor
// The plugin API's version number:
-#define APIVERSION "1.4.3"
-#define APIVERSNUM 10403 // Version * 10000 + Major * 100 + Minor
+#define APIVERSION "1.4.4"
+#define APIVERSNUM 10404 // Version * 10000 + Major * 100 + Minor
// When loading plugins, VDR searches them by their APIVERSION, which
// may be smaller than VDRVERSION in case there have been no changes to
diff --git a/eit.c b/eit.c
index 23ae987..2b07b87 100644
--- a/eit.c
+++ b/eit.c
@@ -8,7 +8,7 @@
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
* Adapted to 'libsi' for VDR 1.3.0 by Marcel Wiesweg <marcel.wiesweg@gmx.de>.
*
- * $Id: eit.c 1.121 2006/10/07 12:32:24 kls Exp $
+ * $Id: eit.c 1.122 2006/10/09 16:14:36 kls Exp $
*/
#include "eit.h"
@@ -234,7 +234,7 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
pEvent->SetTitle(ShortEventDescriptor->name.getText(buffer, sizeof(buffer)));
pEvent->SetShortText(ShortEventDescriptor->text.getText(buffer, sizeof(buffer)));
}
- else {
+ else if (!HasExternalData) {
pEvent->SetTitle(NULL);
pEvent->SetShortText(NULL);
}
@@ -242,7 +242,7 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
char buffer[ExtendedEventDescriptors->getMaximumTextLength(": ") + 1];
pEvent->SetDescription(ExtendedEventDescriptors->getText(buffer, sizeof(buffer), ": "));
}
- else
+ else if (!HasExternalData)
pEvent->SetDescription(NULL);
}
delete ExtendedEventDescriptors;
@@ -250,7 +250,8 @@ cEIT::cEIT(cSchedules *Schedules, int Source, u_char Tid, const u_char *Data, bo
pEvent->SetComponents(Components);
- pEvent->FixEpgBugs();
+ if (!HasExternalData)
+ pEvent->FixEpgBugs();
if (LinkChannels)
channel->SetLinkChannels(LinkChannels);
Modified = true;
diff --git a/i18n.c b/i18n.c
index ee529d4..475264b 100644
--- a/i18n.c
+++ b/i18n.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: i18n.c 1.284 2006/10/08 08:50:30 kls Exp $
+ * $Id: i18n.c 1.285 2006/10/14 09:26:41 kls Exp $
*
* Translations provided by:
*
@@ -3582,7 +3582,7 @@ const tI18nPhrase Phrases[] = {
"ÌïñöÞ áðåéêüíéóçò Âßíôåï",
"Format för video display",
"Formatul redãrii video",
- "",//TODO
+ "Képerny¿formátum",
"",//TODO
"ÈØàÞÚÞíÚàÐÝÝÞÕ Ø×ÞÑàÐÖÕÝØÕ",
"Format video prikaza",
@@ -4596,7 +4596,7 @@ const tI18nPhrase Phrases[] = {
" áÜâãäåÝæçÞèéßêëìíîïüðñóòôõýö÷øùþ0123456789-.#~,/_@abcdefghijklmnopqrstuvwxyz",
" abcdefghijklmnopqrstuvwxyzåäö0123456789-.#~,/_@",
" aãâbcdefghiîjklmnopqrsºtþuvwxyz0123456789-.#~,/_@",
- " aábcdeéfghiíjklmnoóöpqrstuúüvwxyz0123456789-.,#~,/_@",
+ " aábcdeéfghiíjklmnoóö¿pqrstuúü¿vwxyz0123456789-.,#~,/_@",
" aàbcçdeéèfghiíjklmnoòpqrstuúvwxyz0123456789-.,#~,/_@·",
" abcdefghijklmnopqrstuvwxyzÐÑÒÓÔÕñÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìîï0123456789-.#~,/_@",
" abcèædðefghijklmnopqrs¹tuvwxyz¾0123456789-.#~,/_@", // hrv
@@ -4619,7 +4619,7 @@ const tI18nPhrase Phrases[] = {
"",//TODO
" 0\t-.#~,/_@1\tabcåä2\tdef3\tghi4\tjkl5\tmnoö6\tpqrs7\ttuv8\twxyz",
" 0\t-.#~,/_@1\taãâbc2\tdef3\tghiî4\tjkl5\tmno6\tpqrsº7\ttþuv8\twxyz9",
- "",//TODO
+ " 0\t-.#~,/_@1\taábc2\tdeé3\tghií4\tjkl5\tmnoóö¿6\tpqrs7\ttuúü¿v8\twxyz9",
"",//TODO
"",//TODO
"",//TODO
diff --git a/keys.c b/keys.c
index 6ebdbfe..577dae2 100644
--- a/keys.c
+++ b/keys.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: keys.c 1.13 2006/04/15 13:50:43 kls Exp $
+ * $Id: keys.c 1.14 2006/10/14 10:18:05 kls Exp $
*/
#include "keys.h"
@@ -186,8 +186,9 @@ void cKeys::PutSetup(const char *Remote, const char *Setup)
cKeyMacro::cKeyMacro(void)
{
+ numKeys = 0;
for (int i = 0; i < MAXKEYSINMACRO; i++)
- macro[i] = kNone;
+ macro[i] = kNone; // for compatibility with old code that doesn't know about NumKeys()
plugin = NULL;
}
@@ -241,9 +242,9 @@ bool cKeyMacro::Parse(char *s)
return false;
}
}
- if (n < 2) {
- esyslog("ERROR: empty key macro");
- }
+ if (n < 2)
+ esyslog("ERROR: empty key macro"); // non fatal
+ numKeys = n;
return true;
}
diff --git a/keys.h b/keys.h
index 4fa1337..be87c79 100644
--- a/keys.h
+++ b/keys.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: keys.h 1.9 2006/04/15 13:56:03 kls Exp $
+ * $Id: keys.h 1.10 2006/10/14 10:41:20 kls Exp $
*/
#ifndef __KEYS_H
@@ -117,11 +117,16 @@ extern cKeys Keys;
class cKeyMacro : public cListObject {
private:
eKeys macro[MAXKEYSINMACRO];
+ int numKeys;
char *plugin;
public:
cKeyMacro(void);
~cKeyMacro();
bool Parse(char *s);
+ int NumKeys(void) const { return numKeys; }
+ ///< Returns the number of keys in this macro. The first key (with
+ ///< index 0) is the macro code. The actual macro expansion codes
+ ///< start at index 1 and go to NumKeys() - 1.
const eKeys *Macro(void) const { return macro; }
const char *Plugin(void) const { return plugin; }
};
diff --git a/plugin.c b/plugin.c
index 40b4494..569e941 100644
--- a/plugin.c
+++ b/plugin.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: plugin.c 1.23 2006/08/13 08:51:44 kls Exp $
+ * $Id: plugin.c 1.24 2006/10/14 09:49:16 kls Exp $
*/
#include "plugin.h"
@@ -416,7 +416,7 @@ cPlugin *cPluginManager::GetPlugin(int Index)
cPlugin *cPluginManager::GetPlugin(const char *Name)
{
- if (pluginManager) {
+ if (pluginManager && Name) {
for (cDll *dll = pluginManager->dlls.First(); dll; dll = pluginManager->dlls.Next(dll)) {
cPlugin *p = dll->Plugin();
if (p && strcmp(p->Name(), Name) == 0)
diff --git a/remote.c b/remote.c
index a427740..112f6c1 100644
--- a/remote.c
+++ b/remote.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remote.c 1.51 2006/05/12 12:40:15 kls Exp $
+ * $Id: remote.c 1.54 2006/10/14 11:05:57 kls Exp $
*/
#include "remote.h"
@@ -29,7 +29,8 @@ cRemote *cRemote::learning = NULL;
char *cRemote::unknownCode = NULL;
cMutex cRemote::mutex;
cCondVar cRemote::keyPressed;
-const char *cRemote::plugin = NULL;
+const char *cRemote::keyMacroPlugin = NULL;
+const char *cRemote::callPlugin = NULL;
cRemote::cRemote(const char *Name)
{
@@ -105,14 +106,11 @@ bool cRemote::PutMacro(eKeys Key)
{
const cKeyMacro *km = KeyMacros.Get(Key);
if (km) {
- plugin = km->Plugin();
- for (int i = 1; i < MAXKEYSINMACRO; i++) {
- if (km->Macro()[i] != kNone) {
- if (!Put(km->Macro()[i]))
- return false;
- }
- else
- break;
+ keyMacroPlugin = km->Plugin();
+ cMutexLock MutexLock(&mutex);
+ for (int i = km->NumKeys(); --i > 0; ) {
+ if (!Put(km->Macro()[i], true))
+ return false;
}
}
return true;
@@ -148,8 +146,8 @@ bool cRemote::Put(const char *Code, bool Repeat, bool Release)
bool cRemote::CallPlugin(const char *Plugin)
{
cMutexLock MutexLock(&mutex);
- if (!plugin) {
- plugin = Plugin;
+ if (!callPlugin) {
+ callPlugin = Plugin;
Put(k_Plugin);
return true;
}
@@ -159,8 +157,13 @@ bool cRemote::CallPlugin(const char *Plugin)
const char *cRemote::GetPlugin(void)
{
cMutexLock MutexLock(&mutex);
- const char *p = plugin;
- plugin = NULL;
+ const char *p = keyMacroPlugin;
+ if (p)
+ keyMacroPlugin = NULL;
+ else {
+ p = callPlugin;
+ callPlugin = NULL;
+ }
return p;
}
diff --git a/remote.h b/remote.h
index 3a2bb74..4477666 100644
--- a/remote.h
+++ b/remote.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: remote.h 1.35 2006/04/17 08:59:48 kls Exp $
+ * $Id: remote.h 1.37 2006/10/14 11:46:58 kls Exp $
*/
#ifndef __REMOTE_H
@@ -19,7 +19,7 @@
class cRemote : public cListObject {
private:
- enum { MaxKeys = MAXKEYSINMACRO };
+ enum { MaxKeys = 2 * MAXKEYSINMACRO };
static eKeys keys[MaxKeys];
static int in;
static int out;
@@ -28,7 +28,8 @@ private:
static char *unknownCode;
static cMutex mutex;
static cCondVar keyPressed;
- static const char *plugin;
+ static const char *keyMacroPlugin;
+ static const char *callPlugin;
char *name;
protected:
cRemote(const char *Name);
@@ -56,7 +57,7 @@ public:
///< false will be returned and the caller should try again later.
static const char *GetPlugin(void);
///< Returns the name of the plugin that was set with a previous
- ///< call to CallPlugin(). The internally stored pointer to the
+ ///< call to PutMacro() or CallPlugin(). The internally stored pointer to the
///< plugin name will be reset to NULL by this call.
static bool HasKeys(void);
static eKeys Get(int WaitMs = 1000, char **UnknownCode = NULL);
diff --git a/vdr.c b/vdr.c
index 46d65c8..73c5c91 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
- * $Id: vdr.c 1.279 2006/09/01 12:57:44 kls Exp $
+ * $Id: vdr.c 1.280 2006/10/14 10:01:32 kls Exp $
*/
#include <getopt.h>
@@ -923,17 +923,20 @@ int main(int argc, char *argv[])
case kCommands: DirectMainFunction(osCommands); break;
case kUser1 ... kUser9: cRemote::PutMacro(key); key = kNone; break;
case k_Plugin: {
- DELETE_MENU;
- if (cControl::Control())
- cControl::Control()->Hide();
- cPlugin *plugin = cPluginManager::GetPlugin(cRemote::GetPlugin());
- if (plugin) {
- Menu = plugin->MainMenuAction();
- if (Menu)
- Menu->Show();
+ const char *PluginName = cRemote::GetPlugin();
+ if (PluginName) {
+ DELETE_MENU;
+ if (cControl::Control())
+ cControl::Control()->Hide();
+ cPlugin *plugin = cPluginManager::GetPlugin(PluginName);
+ if (plugin) {
+ Menu = plugin->MainMenuAction();
+ if (Menu)
+ Menu->Show();
+ }
+ else
+ esyslog("ERROR: unknown plugin '%s'", PluginName);
}
- else
- esyslog("ERROR: unknown plugin '%s'", cRemote::GetPlugin());
key = kNone; // nobody else needs to see these keys
}
break;