Browse files

Add initial 'beta' UPnP MediaServer support to mythfrontend.

This still has a raft of issues and is disabled by default. To enable,
set the environment variable MYTHTV_UPNPSCANNER and switch to File
Browse Mode in MythVideo.

Known issues:-

- on at least one system here, there is some sort of race/thread lockup
that can delay mythfrontend startup for 30-40 seconds. Seems to be
something to do with the storm of UPnP related messages pinging around
following the SSDP scan - but sometimes startup is normal.

- there are various issues with StreamingRingBuffer that prevent
playback of certain file types (that should otherwise work). While some
file types still need to be filtered out (e.g. iso's), there are still
many files that should play without issue but don't. Sometimes a file
will fail first time around and then play quite happily if reselected
(mostly Play On). Other issues may be server related (e.g. MediaTomb
seems to offer up wmv files and then returns a 404).

- scanning of some servers takes too long. The Play On server, for
example, contains a sizeable file structure that takes 10s of minutes to
scan (at least 90s just for the YouTube directory)- whereas the current
timeout for scanning is 30 seconds to maintain a happy user. While the
scan results are cached, an update can be issued every couple of minutes
- which requires a rescan... All told, I think a different approach is
needed that scans and presents directories as required but I can't see
how that fits into the current MythVideo setup. Perhaps we need a more
traditional file browser for 'external' media.
  • Loading branch information...
1 parent fefca2c commit 17c45ca543224efe53f2d1a119dce3d63df70eb5 Mark Kendall committed Jul 7, 2011
@@ -235,6 +235,8 @@ bool UPNPSubscription::ProcessRequest(HttpWorkerThread *pThread,
return true;
+ VERBOSE(VB_UPNP|VB_EXTRA, "/n/n" + body.toString(4) + "/n/n");
QDomNodeList properties = body.elementsByTagName("property");
QHash<QString,QString> results;
@@ -280,15 +280,21 @@ MediaRenderer::MediaRenderer()
// VERBOSE(VB_UPNP, QString( "MediaRenderer::Registering RenderingControl Service." ));
// m_pHttpServer->RegisterExtension( m_pUPnpRCTL= new UPnpRCTL( RootDevice() ));
- //VERBOSE(VB_UPNP, QString("MediaRenderer: Registering subscription service."));
- //UPNPSubscription *subscription =
- // new UPNPSubscription(m_pHttpServer->m_sSharePath, nPort);
- //m_pHttpServer->RegisterExtension(subscription);
+ UPNPSubscription *subscription = NULL;
+ if (getenv("MYTHTV_UPNPSCANNER"))
+ {
+ QString("MediaRenderer: Registering subscription service."));
+ subscription = new UPNPSubscription(m_pHttpServer->m_sSharePath, nPort);
+ m_pHttpServer->RegisterExtension(subscription);
+ }
// Start scanning for UPnP media servers
- //UPNPScanner::Enable(true, subscription);
+ if (subscription)
+ UPNPScanner::Enable(true, subscription);
// ensure the frontend is aware of all backends (slave and master) and
// other frontends
@@ -308,5 +314,6 @@ MediaRenderer::MediaRenderer()
+ UPNPScanner::Enable(false);
delete m_pHttpServer;
Oops, something went wrong.

0 comments on commit 17c45ca

Please sign in to comment.