Permalink
Browse files

Try to mimic a tad closer to an actual AppleTV.

Sometimes AirPlay photo isn't seen on my mac... so just in case...
  • Loading branch information...
jyavenard committed Jul 3, 2013
1 parent 84f308d commit cbe41f266d7cc846285dc99164297cafdab667a0
@@ -116,13 +116,16 @@ QString AirPlayHardwareId()
QString key = "AirPlayId";
QString id = gCoreContext->GetSetting(key);
int size = id.size();
if (size == 12)
if (size == 12 && id.toUpper() == id)
return id;
QByteArray ba;
for (int i = 0; i < AIRPLAY_HARDWARE_ID_SIZE; i++)
ba.append((random() % 80) + 33);
id = ba.toHex();
if (size == 12)
{
QByteArray ba;
for (int i = 0; i < AIRPLAY_HARDWARE_ID_SIZE; i++)
ba.append((random() % 80) + 33);
id = ba.toHex();
}
id = id.toUpper();
gCoreContext->SaveSetting(key, id);
return id;
@@ -169,15 +169,13 @@ bool MythRAOPDevice::RegisterForBonjour(void)
name.append(gCoreContext->GetHostName());
QByteArray type = "_raop._tcp";
QByteArray txt;
txt.append(6); txt.append("tp=UDP");
txt.append(8); txt.append("sm=false");
txt.append(8); txt.append("sv=false");
txt.append(4); txt.append("ek=1"); //
txt.append(6); txt.append("et=0,1"); // encryption type: no, RSA
txt.append(6); txt.append("cn=0,1"); // audio codec: pcm, alac
txt.append(9); txt.append("txtvers=1"); // TXT record version 1
txt.append(4); txt.append("ch=2"); // audio channels
txt.append(5); txt.append("ss=16"); // sample size
txt.append(8); txt.append("sr=44100"); // sample rate
txt.append(6); txt.append("cn=0,1"); // audio codec: pcm, alac
txt.append(4); txt.append("ek=1"); // without this, iTunes doesn't see us
txt.append(7); txt.append("da=true");
txt.append(6); txt.append("et=0,1"); // encryption type: no, RSA
txt.append(8); txt.append("md=0,1,2"); // metadata-type: text, artwork, progress
if (gCoreContext->GetNumSetting("AirPlayPasswordEnabled"))
{
txt.append(7); txt.append("pw=true");
@@ -186,11 +184,14 @@ bool MythRAOPDevice::RegisterForBonjour(void)
{
txt.append(8); txt.append("pw=false");
}
txt.append(4); txt.append("vn=3");
txt.append(9); txt.append("txtvers=1"); // TXT record version 1
txt.append(8); txt.append("md=0,1,2"); // metadata-type: text, artwork, progress
txt.append(8); txt.append("sv=false");
txt.append(8); txt.append("sr=44100"); // sample rate
txt.append(5); txt.append("ss=16"); // sample size
txt.append(6); txt.append("tp=UDP");
txt.append(8); txt.append("vn=65537");
txt.append(9); txt.append("vs=130.14");
txt.append(7); txt.append("da=true");
txt.append(13); txt.append("am=AppleTV2,1");
txt.append(6); txt.append("sf=0x4");
LOG(VB_GENERAL, LOG_INFO, QString("Registering service %1.%2 port %3 TXT %4")
.arg(QString(name)).arg(QString(type)).arg(m_setupPort).arg(QString(txt)));

0 comments on commit cbe41f2

Please sign in to comment.