xbmc/xbmc — pull request #2864 by Memphiz (2013-06-11 08:43:45+00:00)
Title: [mdnsembedded] - fix zeroconfbrowser

As pointed out in the former pull request which added zeroconf support for android by utilising mdnsembedded - the zeroconfbrowser was deactivated because browsing worked - but resolving into an ip didn't.

I tracked it down to the following reason:

1. In the resolve callback we used our CDNSNameCache to resolve the hostname - which always failed on android (for example our CDNSNameCache was not able to resolve DockStar.local. to an ip) - not sure why it works on windows - but gethostbyname definitly doesn't resolve .local domains on my odroid-x.

I solved it by:

1. Moving the DNSCache out of the callback into the zeroconfthread (else the callback could stall and timeout)
2. Falling back to the mdns resolver (DNSServiceGetAddrInfo) when our CDNSNameCache fails

This PR also bumps the version of mdnsresponder to the latest. Speed of browsing is now same as on all other implementations (before it lasted about 5 secs before the list showed up).

@wsoltys do you think we even need the CDNSNameCache? Imo it would be sufficient to leave the resolution of local. hostnames to mdns completly - it caches aswell and is able to resolve those local domains without issues. Would be cool if you could give it a shot (just comment out the call to CDNSNameCache::Lookup in ZeroconfBrowserMDNS.cpp and see if it works on windows aswell...

This fixes zeroconfbrowser support for android and therefor completes zeroconf support. (and i consider this a fix and want to pull it as soon as i get the sign-off by @wsoltys ...)

@TheUni - we need the multicastlock for wifi networks then ;)