diff options
author | methodus <methodus@web.de> | 2013-04-27 09:42:33 +0200 |
---|---|---|
committer | methodus <methodus@web.de> | 2013-04-27 09:42:33 +0200 |
commit | e0813ab8cfdee367ab6138c0227205274c76ffe1 (patch) | |
tree | a7b247527185aa7ca324aa970001e59bc0c4d430 | |
parent | bcc8e557adb68576c44fd07ce19a9d3d96786af3 (diff) | |
download | vdr-plugin-upnp-e0813ab8cfdee367ab6138c0227205274c76ffe1.tar.gz vdr-plugin-upnp-e0813ab8cfdee367ab6138c0227205274c76ffe1.tar.bz2 |
Possible fix for high CPU load when refreshing EPG
-rw-r--r-- | include/media/mediaManager.h | 4 | ||||
-rw-r--r-- | include/plugin.h | 8 | ||||
-rw-r--r-- | media/mediaManager.cpp | 19 | ||||
-rw-r--r-- | media/pluginManager.cpp | 2 | ||||
-rw-r--r-- | plugins/provider/vdrProvider/vdrProvider.cpp | 10 | ||||
-rw-r--r-- | po/de_DE.po | 248 | ||||
-rw-r--r-- | po/fi_FI.po | 214 |
7 files changed, 253 insertions, 252 deletions
diff --git a/include/media/mediaManager.h b/include/media/mediaManager.h index 9857d50..10cb9e9 100644 --- a/include/media/mediaManager.h +++ b/include/media/mediaManager.h @@ -23,7 +23,7 @@ class cResourceStreamer; class cPluginManager; class cMediaManager : public cThread { - friend void cUPnPResourceProvider::OnContainerUpdate(const string& uri, long updateID, const string& target = string()); + friend void cUPnPResourceProvider::OnContainerUpdate(const string& uri, long updateID, const StringList& target = StringList()); private: struct MediaRequest { @@ -82,7 +82,7 @@ private: int CreateResponse(MediaRequest&, const string&, const string&); - void OnContainerUpdate(const string& uri, long updateID, const string& target); + void OnContainerUpdate(const string& uri, long updateID, const StringList& target); bool UpdateContainerUpdateId(const string& objectID, long updateID); bool ScanURI(const string& uri, cUPnPResourceProvider* provider); diff --git a/include/plugin.h b/include/plugin.h index fa167b7..e3073f4 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -473,12 +473,12 @@ protected: * - change of the parent container, where the file or container * was moved to * - * The optional target must be an element inside the container - * specified in the URI. If the target is not empty, only this - * element will be checked for changes. Otherwise the full container + * The optional target list contains elements inside the container + * specified in the URI. If the target list is not empty, only those + * elements will be checked for changes. Otherwise the full container * is scanned. */ - void OnContainerUpdate(const string& uri, long containerUpdateId, const string& target = string()); + void OnContainerUpdate(const string& uri, long containerUpdateId, const StringList& target = StringList()); /** * Load a configuration file. diff --git a/media/mediaManager.cpp b/media/mediaManager.cpp index 199a942..c1b84a3 100644 --- a/media/mediaManager.cpp +++ b/media/mediaManager.cpp @@ -133,7 +133,7 @@ IdList cMediaManager::GetContainerUpdateIDs(bool unevented){ return list; } -void cMediaManager::OnContainerUpdate(const string& uri, long updateID, const string& target){ +void cMediaManager::OnContainerUpdate(const string& uri, long updateID, const StringList& target){ systemUpdateID = time(NULL); string objectID = tools::GenerateUUIDFromURL(uri); @@ -144,16 +144,17 @@ void cMediaManager::OnContainerUpdate(const string& uri, long updateID, const st // does not exist. Therefore, we cannot scan this directory successfully. if(!UpdateContainerUpdateId(objectID, updateID)) return; - stringstream ss; - - ss << uri; - - if(!target.empty()){ - ss << target; + if(target.empty()){ + scanTargets.push_back(uri); + } else { + stringstream ss; + for(StringList::const_iterator it = target.begin(); it != target.end(); ++it){ + ss.str(); + ss << uri << *it; + scanTargets.push_back(ss.str()); + } } - scanTargets.push_back(ss.str()); - // Start scanning for changed files. Start(); } diff --git a/media/pluginManager.cpp b/media/pluginManager.cpp index 32a2436..a17e9c9 100644 --- a/media/pluginManager.cpp +++ b/media/pluginManager.cpp @@ -310,7 +310,7 @@ bool cUPnPResourceProvider::Seek(size_t offset, int origin){ void cUPnPResourceProvider::Close(){ } -void cUPnPResourceProvider::OnContainerUpdate(const string& uri, long int cUID, const string& target){ +void cUPnPResourceProvider::OnContainerUpdate(const string& uri, long int cUID, const StringList& target){ cMediaServer::GetInstance()->GetManager().OnContainerUpdate(uri, cUID, target); } diff --git a/plugins/provider/vdrProvider/vdrProvider.cpp b/plugins/provider/vdrProvider/vdrProvider.cpp index 4f7276a..9f893b6 100644 --- a/plugins/provider/vdrProvider/vdrProvider.cpp +++ b/plugins/provider/vdrProvider/vdrProvider.cpp @@ -190,16 +190,13 @@ public: long now = 0; bool modified = false; + StringList targets; while(Running()){ event = NULL; now = time(NULL); - if(!Channels.BeingEdited() && Channels.Modified() > 0){ - modified = true; - } - { // Reduce Scope of Schedules lock. cSchedulesLock lock; Schedules = cSchedules::Schedules(lock); @@ -216,9 +213,11 @@ public: // will be skipped. if(event->StartTime() > lastModified && event->StartTime() < now + SLEEP_TIMEOUT){ modified = true; + targets.push_back(*event->ChannelID().ToString()); break; } } else if(Schedule->Modified() > lastModified){ + targets.push_back(*event->ChannelID().ToString()); modified = true; break; } @@ -227,7 +226,8 @@ public: } if(modified){ - OnContainerUpdate(GetRootContainer(), now); + OnContainerUpdate(GetRootContainer(), now, targets); + targets.clear(); modified = false; lastModified = now; } diff --git a/po/de_DE.po b/po/de_DE.po index 9f51a29..4bdd048 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-upnp 1.0.0\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-01-03 09:22+0100\n" +"POT-Creation-Date: 2013-04-21 11:57+0200\n" "PO-Revision-Date: 2012-11-01 16:04+0100\n" "Last-Translator: Denis Loh <denis.loh@web.de>\n" "Language-Team: German\n" @@ -17,98 +17,77 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -msgid "UPnP/DLNA compliant Media Server functionality for VDR" -msgstr "UPnP/DLNA-konformer Media Server für den VDR" +msgid "Enable UPnP server" +msgstr "UPnP-Server einschalten" -msgid "" -" The UPnP/DLNA server is designed to detect everything automatically.\n" -" Therefore the user is not required to change most of the settings.\n" -" \n" -" -d <DB directory> --db-dir=<DB directory> Specifies the directory\n" -" where the the database\n" -" file shall be located.\n" -" -a <IP address> --address=<IP address> Binds the server to the\n" -" specific IP address.\n" -" -i <Interface> --interface=<Interface> Binds the server to the\n" -" specific network\n" -" interface.\n" -" -p <Port> --port=<Port> Sets the port where the\n" -" UPnP server shall listen\n" -" on." -msgstr "" -" Der UPnP/DLNA-Server ist so ausgelegt, dass alle Einstellungen\n" -" automatisch erkannt werden. Es ist daher nicht notwendig, dass\n" -" Einstellungen durch den Nutzer vorgenommen werden müssen\n" -" \n" -" -d <DB Verzeichnis> --db-dir=<DB Verzeichnis> Legt das Verzeichnis\n" -" fest, wo die Datenbank-\n" -" datei gespeichert werden\n" -" soll.\n" -" -a <IP-Adresse> --address=<IP-Adresse> Bindet den Server an\n" -" diese IP-Adresse\n" -" -i <Interface> --interface=<Interface> Bindet den Server an\n" -" diese Netzwerkkarte\n" -" -p <Port> --port=<Port> Setzt den Port, auf den\n" -" der UPnP server lauschen\n" -" soll." +msgid "disabled" +msgstr "inaktiv" -#, c-format -msgid "There are %d requests active." -msgstr "Es sind noch %d Anfragen aktiv." +msgid "enabled" +msgstr "aktiv" -msgid "Invalid action" -msgstr "" +msgid "Use expert settings" +msgstr "Experteneinstellungen" -msgid "Invalid args" -msgstr "" +msgid "Webserver settings" +msgstr "Webservereinstellungen" -msgid "Invalid var" -msgstr "" +msgid "Webserver root directory" +msgstr "Webserverwurzelverzeichnis" -msgid "Action failed" -msgstr "" +msgid "Webserver port (0=auto)" +msgstr "Webserverport (0=auto)" -msgid "Argument value invalid" -msgstr "" +msgid "Max. request time in seconds (0=auto)" +msgstr "Max. Anfragezeit in Sekunden (0=auto)" -msgid "Argument value out of range" -msgstr "" +msgid "Presentation URL" +msgstr "Präsentationswebseite" -msgid "Optional action not implemented" -msgstr "" +msgid "Use \"live\" plugin for presentation" +msgstr "\"Live\"-Plugin als Webseite verwenden" -msgid "Out of memory" -msgstr "" +msgid "Live webserver port (0=auto)" +msgstr "Webserver port des Live-Plugins (0=auto)" -msgid "Human intervention required" -msgstr "" +msgid "UPnP server settings" +msgstr "UPnP-Servereinstellungen" -msgid "String argument to long" -msgstr "" +msgid "Generate new device UUID" +msgstr "Neue Geräte-UUID generieren" -msgid "Action not authorized" -msgstr "" +msgid "Current device UUID" +msgstr "Aktuelle Geräte-UUID" -msgid "Signature failure" -msgstr "" +msgid "Max. content length of SOAP Messages" +msgstr "Max. SOAP-Messagegröße" -msgid "Signature missing" -msgstr "" +msgid "Max. age of UPnP announcements" +msgstr "Max. Alter der UPnP-Mitteilungen" -msgid "Not encrypted" -msgstr "" +msgid "Bind UPnP server to " +msgstr "UPnP-Server lauscht auf " -msgid "Invalid sequence" -msgstr "" +msgid "interface" +msgstr "Netzwerkkarte" -msgid "Invalid control URL" -msgstr "" +msgid "address" +msgstr "IP-Adresse" -msgid "No such session" -msgstr "" +msgid "Set IP address" +msgstr "Ip-Adresse einstellen" -msgid "Unknown error code. Contact the device manufacturer" -msgstr "" +msgid "Set network interface" +msgstr "Netzwerkkarte einstellen" + +msgid "UPnP server port (0=auto)" +msgstr "UPnP Serverport (0=auto)" + +msgid "Database settings" +msgstr "Datenbankeinstellungen" + +msgid "Path to database file" +msgstr "Pfad zur Datenbankdatei" msgid "Incompatible protocol info" msgstr "" @@ -188,74 +167,95 @@ msgstr "" msgid "Transfer busy" msgstr "" -msgid "Enable UPnP server" -msgstr "UPnP-Server einschalten" - -msgid "disabled" -msgstr "inaktiv" - -msgid "enabled" -msgstr "aktiv" - -msgid "Use expert settings" -msgstr "Experteneinstellungen" +msgid "Invalid action" +msgstr "" -msgid "Webserver settings" -msgstr "Webservereinstellungen" +msgid "Invalid args" +msgstr "" -msgid "Webserver root directory" -msgstr "Webserverwurzelverzeichnis" +msgid "Invalid var" +msgstr "" -msgid "Webserver port (0=auto)" -msgstr "Webserverport (0=auto)" +msgid "Action failed" +msgstr "" -msgid "Max. request time in seconds (0=auto)" -msgstr "Max. Anfragezeit in Sekunden (0=auto)" +msgid "Argument value invalid" +msgstr "" -msgid "Presentation URL" -msgstr "Präsentationswebseite" +msgid "Argument value out of range" +msgstr "" -msgid "Use \"live\" plugin for presentation" -msgstr "\"Live\"-Plugin als Webseite verwenden" +msgid "Optional action not implemented" +msgstr "" -msgid "Live webserver port (0=auto)" -msgstr "Webserver port des Live-Plugins (0=auto)" +msgid "Out of memory" +msgstr "" -msgid "UPnP server settings" -msgstr "UPnP-Servereinstellungen" +msgid "Human intervention required" +msgstr "" -msgid "Generate new device UUID" -msgstr "Neue Geräte-UUID generieren" +msgid "String argument to long" +msgstr "" -msgid "Current device UUID" -msgstr "Aktuelle Geräte-UUID" +msgid "Action not authorized" +msgstr "" -msgid "Max. content length of SOAP Messages" -msgstr "Max. SOAP-Messagegröße" +msgid "Signature failure" +msgstr "" -msgid "Max. age of UPnP announcements" -msgstr "Max. Alter der UPnP-Mitteilungen" +msgid "Signature missing" +msgstr "" -msgid "Bind UPnP server to " -msgstr "UPnP-Server lauscht auf " +msgid "Not encrypted" +msgstr "" -msgid "interface" -msgstr "Netzwerkkarte" +msgid "Invalid sequence" +msgstr "" -msgid "address" -msgstr "IP-Adresse" +msgid "Invalid control URL" +msgstr "" -msgid "Set IP address" -msgstr "Ip-Adresse einstellen" +msgid "No such session" +msgstr "" -msgid "Set network interface" -msgstr "Netzwerkkarte einstellen" +msgid "Unknown error code. Contact the device manufacturer" +msgstr "" -msgid "UPnP server port (0=auto)" -msgstr "UPnP Serverport (0=auto)" +msgid "" +" The UPnP/DLNA server is designed to detect everything automatically.\n" +" Therefore the user is not required to change most of the settings.\n" +" \n" +" -d <DB directory> --db-dir=<DB directory> Specifies the directory\n" +" where the the database\n" +" file shall be located.\n" +" -a <IP address> --address=<IP address> Binds the server to the\n" +" specific IP address.\n" +" -i <Interface> --interface=<Interface> Binds the server to the\n" +" specific network\n" +" interface.\n" +" -p <Port> --port=<Port> Sets the port where the\n" +" UPnP server shall listen\n" +" on." +msgstr "" +" Der UPnP/DLNA-Server ist so ausgelegt, dass alle Einstellungen\n" +" automatisch erkannt werden. Es ist daher nicht notwendig, dass\n" +" Einstellungen durch den Nutzer vorgenommen werden müssen\n" +" \n" +" -d <DB Verzeichnis> --db-dir=<DB Verzeichnis> Legt das Verzeichnis\n" +" fest, wo die Datenbank-\n" +" datei gespeichert werden\n" +" soll.\n" +" -a <IP-Adresse> --address=<IP-Adresse> Bindet den Server an\n" +" diese IP-Adresse\n" +" -i <Interface> --interface=<Interface> Bindet den Server an\n" +" diese Netzwerkkarte\n" +" -p <Port> --port=<Port> Setzt den Port, auf den\n" +" der UPnP server lauschen\n" +" soll." -msgid "Database settings" -msgstr "Datenbankeinstellungen" +#, c-format +msgid "There are %d requests active." +msgstr "Es sind noch %d Anfragen aktiv." -msgid "Path to database file" -msgstr "Pfad zur Datenbankdatei" +msgid "UPnP/DLNA compliant Media Server functionality for VDR" +msgstr "UPnP/DLNA-konformer Media Server für den VDR" diff --git a/po/fi_FI.po b/po/fi_FI.po index bab583f..950fddf 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-upnp 1.0.0\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-01-03 09:22+0100\n" +"POT-Creation-Date: 2013-04-21 11:57+0200\n" "PO-Revision-Date: 2012-10-31 10:31+0200\n" "Last-Translator: Rolf Ahrenberg\n" "Language-Team: Finnish <vdr@linuxtv.org>\n" @@ -16,83 +16,77 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -msgid "UPnP/DLNA compliant Media Server functionality for VDR" -msgstr "UPnP/DLNA-mediapalvelin VDR:lle" +msgid "Enable UPnP server" +msgstr "UPnP-palvelin" -msgid "" -" The UPnP/DLNA server is designed to detect everything automatically.\n" -" Therefore the user is not required to change most of the settings.\n" -" \n" -" -d <DB directory> --db-dir=<DB directory> Specifies the directory\n" -" where the the database\n" -" file shall be located.\n" -" -a <IP address> --address=<IP address> Binds the server to the\n" -" specific IP address.\n" -" -i <Interface> --interface=<Interface> Binds the server to the\n" -" specific network\n" -" interface.\n" -" -p <Port> --port=<Port> Sets the port where the\n" -" UPnP server shall listen\n" -" on." -msgstr "" +msgid "disabled" +msgstr "ei käytössä" -#, c-format -msgid "There are %d requests active." -msgstr "" +msgid "enabled" +msgstr "käytössä" -msgid "Invalid action" -msgstr "" +msgid "Use expert settings" +msgstr "Näytä lisäasetukset" -msgid "Invalid args" -msgstr "" +msgid "Webserver settings" +msgstr "Web-palvelimen asetukset" -msgid "Invalid var" -msgstr "" +msgid "Webserver root directory" +msgstr "Web-palvelimen juurihakemisto" -msgid "Action failed" -msgstr "" +msgid "Webserver port (0=auto)" +msgstr "Web-palvelimen portti (0=auto)" -msgid "Argument value invalid" +msgid "Max. request time in seconds (0=auto)" msgstr "" -msgid "Argument value out of range" -msgstr "" +msgid "Presentation URL" +msgstr "Esitys-URL" -msgid "Optional action not implemented" -msgstr "" +msgid "Use \"live\" plugin for presentation" +msgstr "Käytä \"live\"-laajennosta esityksiin" -msgid "Out of memory" -msgstr "" +msgid "Live webserver port (0=auto)" +msgstr "Live-laajennoksen portti (0=auto)" -msgid "Human intervention required" -msgstr "" +msgid "UPnP server settings" +msgstr "UPnP-palvelimen asetukset" -msgid "String argument to long" -msgstr "" +msgid "Generate new device UUID" +msgstr "Luo uusi UUID laitteelle" -msgid "Action not authorized" -msgstr "" +msgid "Current device UUID" +msgstr "Nykyinen laitteen UUID" -msgid "Signature failure" -msgstr "" +msgid "Max. content length of SOAP Messages" +msgstr "SOAP-viestien suurin pituus" -msgid "Signature missing" -msgstr "" +msgid "Max. age of UPnP announcements" +msgstr "UPnP-ilmoitusten suurin kestoaika" -msgid "Not encrypted" -msgstr "" +msgid "Bind UPnP server to " +msgstr "Sido UPnP-palvelin" -msgid "Invalid sequence" -msgstr "" +msgid "interface" +msgstr "sovittimeen" -msgid "Invalid control URL" -msgstr "" +msgid "address" +msgstr "osoitteeseen" -msgid "No such session" -msgstr "" +msgid "Set IP address" +msgstr "Aseta IP-osoite" -msgid "Unknown error code. Contact the device manufacturer" -msgstr "" +msgid "Set network interface" +msgstr "Aseta verkkosovitin" + +msgid "UPnP server port (0=auto)" +msgstr "UPnP-palvelimen portti (0=auto)" + +msgid "Database settings" +msgstr "Tietokanta-asetukset" + +msgid "Path to database file" +msgstr "Tiedostopolku tietokannalle" msgid "Incompatible protocol info" msgstr "" @@ -172,74 +166,80 @@ msgstr "" msgid "Transfer busy" msgstr "" -msgid "Enable UPnP server" -msgstr "UPnP-palvelin" - -msgid "disabled" -msgstr "ei käytössä" - -msgid "enabled" -msgstr "käytössä" - -msgid "Use expert settings" -msgstr "Näytä lisäasetukset" +msgid "Invalid action" +msgstr "" -msgid "Webserver settings" -msgstr "Web-palvelimen asetukset" +msgid "Invalid args" +msgstr "" -msgid "Webserver root directory" -msgstr "Web-palvelimen juurihakemisto" +msgid "Invalid var" +msgstr "" -msgid "Webserver port (0=auto)" -msgstr "Web-palvelimen portti (0=auto)" +msgid "Action failed" +msgstr "" -msgid "Max. request time in seconds (0=auto)" +msgid "Argument value invalid" msgstr "" -msgid "Presentation URL" -msgstr "Esitys-URL" +msgid "Argument value out of range" +msgstr "" -msgid "Use \"live\" plugin for presentation" -msgstr "Käytä \"live\"-laajennosta esityksiin" +msgid "Optional action not implemented" +msgstr "" -msgid "Live webserver port (0=auto)" -msgstr "Live-laajennoksen portti (0=auto)" +msgid "Out of memory" +msgstr "" -msgid "UPnP server settings" -msgstr "UPnP-palvelimen asetukset" +msgid "Human intervention required" +msgstr "" -msgid "Generate new device UUID" -msgstr "Luo uusi UUID laitteelle" +msgid "String argument to long" +msgstr "" -msgid "Current device UUID" -msgstr "Nykyinen laitteen UUID" +msgid "Action not authorized" +msgstr "" -msgid "Max. content length of SOAP Messages" -msgstr "SOAP-viestien suurin pituus" +msgid "Signature failure" +msgstr "" -msgid "Max. age of UPnP announcements" -msgstr "UPnP-ilmoitusten suurin kestoaika" +msgid "Signature missing" +msgstr "" -msgid "Bind UPnP server to " -msgstr "Sido UPnP-palvelin" +msgid "Not encrypted" +msgstr "" -msgid "interface" -msgstr "sovittimeen" +msgid "Invalid sequence" +msgstr "" -msgid "address" -msgstr "osoitteeseen" +msgid "Invalid control URL" +msgstr "" -msgid "Set IP address" -msgstr "Aseta IP-osoite" +msgid "No such session" +msgstr "" -msgid "Set network interface" -msgstr "Aseta verkkosovitin" +msgid "Unknown error code. Contact the device manufacturer" +msgstr "" -msgid "UPnP server port (0=auto)" -msgstr "UPnP-palvelimen portti (0=auto)" +msgid "" +" The UPnP/DLNA server is designed to detect everything automatically.\n" +" Therefore the user is not required to change most of the settings.\n" +" \n" +" -d <DB directory> --db-dir=<DB directory> Specifies the directory\n" +" where the the database\n" +" file shall be located.\n" +" -a <IP address> --address=<IP address> Binds the server to the\n" +" specific IP address.\n" +" -i <Interface> --interface=<Interface> Binds the server to the\n" +" specific network\n" +" interface.\n" +" -p <Port> --port=<Port> Sets the port where the\n" +" UPnP server shall listen\n" +" on." +msgstr "" -msgid "Database settings" -msgstr "Tietokanta-asetukset" +#, c-format +msgid "There are %d requests active." +msgstr "" -msgid "Path to database file" -msgstr "Tiedostopolku tietokannalle" +msgid "UPnP/DLNA compliant Media Server functionality for VDR" +msgstr "UPnP/DLNA-mediapalvelin VDR:lle" |