diff options
author | methodus <methodus@web.de> | 2013-05-09 15:57:45 +0200 |
---|---|---|
committer | methodus <methodus@web.de> | 2013-05-09 15:57:45 +0200 |
commit | 11a035aa4ec2b55faaef1eaa48b7726a28422048 (patch) | |
tree | 7bfe8a1589d9ce56f47d76617c938c72323fd3e0 /server | |
parent | a224f8e589038ba17c6c80f1f07656642a4f057a (diff) | |
download | vdr-plugin-upnp-master.tar.gz vdr-plugin-upnp-master.tar.bz2 |
Diffstat (limited to 'server')
-rw-r--r-- | server/server.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/server/server.cpp b/server/server.cpp index 28895ac..4d208bd 100644 --- a/server/server.cpp +++ b/server/server.cpp @@ -215,7 +215,7 @@ bool cMediaServer::Initialize(){ isyslog("UPnP\tInitialized UPnP media server on %s:%d", UpnpGetServerIpAddress(), UpnpGetServerPort()); mWebserver = new cWebserver(GetServerIPAddress()); - mMediaManager = new cMediaManager(); + stringstream ss; if(mCurrentConfiguration.expertSettings){ @@ -252,11 +252,22 @@ bool cMediaServer::Initialize(){ ss << "sqlite:" << mCurrentConfiguration.databaseDir << "/metadata.db"; try { mConnection = tntdb::connect(ss.str()); + + mConnection.execute("PRAGMA foreign_keys = ON"); + mConnection.execute("PRAGMA page_size = 4096"); + mConnection.execute("PRAGMA cache_size = 16384"); + mConnection.execute("PRAGMA temp_store = MEMORY"); + mConnection.execute("PRAGMA synchronous = NORMAL"); + mConnection.execute("PRAGMA locking_mode = EXCLUSIVE"); + + isyslog("UPnP\tSuccessfully connected to %s.", ss.str().c_str()); } catch (const std::exception& e) { esyslog("UPnP\tException occurred while connecting to database '%s': %s", ss.str().c_str(), e.what()); return false; } + mMediaManager = new cMediaManager(); + ret = UpnpSetMaxContentLength(GetMaxContentLength()); if(ret != UPNP_E_SUCCESS){ |