X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=AirTV-Qt%2Fraopservice.cpp;h=19ba624c480438311c92b99849b891e64ee02c3e;hb=4a38142011f7f1c23a408cc9a36af89e6ce336b6;hp=79472c1f0b047f43ed158c85db7fcc243add5f0f;hpb=2340bcd3ce772d058bbeddcadd7a8301f7b18747;p=deb_shairplay.git diff --git a/AirTV-Qt/raopservice.cpp b/AirTV-Qt/raopservice.cpp index 79472c1..19ba624 100644 --- a/AirTV-Qt/raopservice.cpp +++ b/AirTV-Qt/raopservice.cpp @@ -1,3 +1,17 @@ +/** + * Copyright (C) 2011-2012 Juho Vähä-Herttua + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ + #include "raopservice.h" #include @@ -66,6 +80,7 @@ RaopService::~RaopService() bool RaopService::init() { const char hwaddr[] = { 0x48, 0x5d, 0x60, 0x7c, 0xee, 0x22 }; + raop_callbacks_t raop_cbs; int error; @@ -92,7 +107,7 @@ bool RaopService::init() QByteArray array = file.read(file.size()); array.append('\0'); - m_raop = raop_init(&raop_cbs, array.data(), hwaddr, sizeof(hwaddr)); + m_raop = raop_init(&raop_cbs, array.data()); if (!m_raop) { return false; } @@ -109,12 +124,14 @@ bool RaopService::init() bool RaopService::start(const QString & name, quint16 port) { + const char hwaddr[] = { 0x48, 0x5d, 0x60, 0x7c, 0xee, 0x22 }; + if (!m_raop || !m_dnssd || m_thread.isRunning()) { return false; } m_thread.start(); - if (raop_start(m_raop, &port) < 0) { + if (raop_start(m_raop, &port, hwaddr, sizeof(hwaddr)) < 0) { m_thread.quit(); m_thread.wait(); return false;