rendered paste bodyIndex: mythtv/programs/mythbackend/mediaserver.cpp
===================================================================
--- mythtv/programs/mythbackend/mediaserver.cpp (revision 16045)
+++ mythtv/programs/mythbackend/mediaserver.cpp (working copy)
@@ -67,7 +67,40 @@
m_sSharePath = gContext->GetShareDir();
m_pHttpServer->m_sSharePath = m_sSharePath;
+ QString sFileName = g_pConfig->GetValue( "upnpDescXmlPath",
+ m_sSharePath );
+ QString sDeviceType;
+ if ( bIsMaster )
+ {
+ sFileName += "devicemaster.xml";
+ sDeviceType = "urn:schemas-mythtv-org:device:MasterMediaServer:1";
+ }
+ else
+ {
+ sFileName += "deviceslave.xml";
+ sDeviceType = "urn:schemas-mythtv-org:device:SlaveMediaServer:1";
+ }
+
+ // ------------------------------------------------------------------
+ // Make sure our device Description is loaded.
+ // ------------------------------------------------------------------
+
+ VERBOSE(VB_UPNP, "MediaServer::Loading UPnp Description " + sFileName );
+
+ g_UPnpDeviceDesc.Load( sFileName );
+
+ UPnpDevice *pMythDevice = UPnpDeviceDesc::FindDevice( RootDevice(),
+ sDeviceType );
+
+ // ------------------------------------------------------------------
+ // Register the MythXML protocol...
+ // ------------------------------------------------------------------
+
+ VERBOSE(VB_UPNP, "MediaServer::Registering MythXML Service." );
+
+ m_pHttpServer->RegisterExtension( new MythXML( pMythDevice ));
+
if (sIP == "localhost" || sIP == "127.0.0.1")
{
VERBOSE(VB_IMPORTANT, "MediaServer:: Bad BackendServerIP Address - "
@@ -94,41 +127,8 @@
if (Initialize( sIPAddrList, nPort, m_pHttpServer ))
{
- QString sFileName = g_pConfig->GetValue( "upnpDescXmlPath",
- m_sSharePath );
- QString sDeviceType;
- if ( bIsMaster )
- {
- sFileName += "devicemaster.xml";
- sDeviceType = "urn:schemas-mythtv-org:device:MasterMediaServer:1";
- }
- else
- {
- sFileName += "deviceslave.xml";
- sDeviceType = "urn:schemas-mythtv-org:device:SlaveMediaServer:1";
- }
-
// ------------------------------------------------------------------
- // Make sure our device Description is loaded.
- // ------------------------------------------------------------------
-
- VERBOSE(VB_UPNP, "MediaServer::Loading UPnp Description " + sFileName );
-
- g_UPnpDeviceDesc.Load( sFileName );
-
- UPnpDevice *pMythDevice = UPnpDeviceDesc::FindDevice( RootDevice(),
- sDeviceType );
-
- // ------------------------------------------------------------------
- // Register the MythXML protocol...
- // ------------------------------------------------------------------
-
- VERBOSE(VB_UPNP, "MediaServer::Registering MythXML Service." );
-
- m_pHttpServer->RegisterExtension( new MythXML( pMythDevice ));
-
- // ------------------------------------------------------------------
// Register any HttpServerExtensions... Only The Master Backend
// ------------------------------------------------------------------