|
a/src/upmpd.cxx |
|
b/src/upmpd.cxx |
|
... |
|
... |
36 |
#include "renderctl.hxx"
|
36 |
#include "renderctl.hxx"
|
37 |
#include "upmpdutils.hxx"
|
37 |
#include "upmpdutils.hxx"
|
38 |
#include "execmd.h"
|
38 |
#include "execmd.h"
|
39 |
#include "httpfs.hxx"
|
39 |
#include "httpfs.hxx"
|
40 |
#include "ohsndrcv.hxx"
|
40 |
#include "ohsndrcv.hxx"
|
|
|
41 |
#include "protocolinfo.hxx"
|
41 |
|
42 |
|
42 |
using namespace std;
|
43 |
using namespace std;
|
43 |
using namespace std::placeholders;
|
44 |
using namespace std::placeholders;
|
44 |
using namespace UPnPP;
|
45 |
using namespace UPnPP;
|
45 |
|
46 |
|
|
... |
|
... |
61 |
// update the mpd status for everybody
|
62 |
// update the mpd status for everybody
|
62 |
m_avt = new UpMpdAVTransport(this, avtnoev);
|
63 |
m_avt = new UpMpdAVTransport(this, avtnoev);
|
63 |
m_services.push_back(m_avt);
|
64 |
m_services.push_back(m_avt);
|
64 |
m_rdctl = new UpMpdRenderCtl(this, avtnoev);
|
65 |
m_rdctl = new UpMpdRenderCtl(this, avtnoev);
|
65 |
m_services.push_back(m_rdctl);
|
66 |
m_services.push_back(m_rdctl);
|
66 |
m_services.push_back(new UpMpdConMan(this, g_protocolInfo));
|
67 |
m_services.push_back(new UpMpdConMan(this));
|
67 |
|
68 |
|
68 |
if (m_options & upmpdDoOH) {
|
69 |
if (m_options & upmpdDoOH) {
|
69 |
m_ohif = new OHInfo(this);
|
70 |
m_ohif = new OHInfo(this);
|
70 |
m_services.push_back(m_ohif);
|
71 |
m_services.push_back(m_ohif);
|
71 |
m_services.push_back(new OHTime(this));
|
72 |
m_services.push_back(new OHTime(this));
|
|
... |
|
... |
137 |
if ((m_options & upmpdNoContentFormatCheck)) {
|
138 |
if ((m_options & upmpdNoContentFormatCheck)) {
|
138 |
LOGERR("checkContentFormat: format check disabled\n");
|
139 |
LOGERR("checkContentFormat: format check disabled\n");
|
139 |
return dirObjToUpSong(dobj, ups);
|
140 |
return dirObjToUpSong(dobj, ups);
|
140 |
}
|
141 |
}
|
141 |
|
142 |
|
|
|
143 |
const std::unordered_set<std::string>& supportedformats =
|
|
|
144 |
Protocolinfo::the()->getsupportedformats();
|
|
|
145 |
|
142 |
for (vector<UPnPClient::UPnPResource>::const_iterator it =
|
146 |
for (vector<UPnPClient::UPnPResource>::const_iterator it =
|
143 |
dobj.m_resources.begin(); it != dobj.m_resources.end(); it++) {
|
147 |
dobj.m_resources.begin(); it != dobj.m_resources.end(); it++) {
|
144 |
if (!it->m_uri.compare(uri)) {
|
148 |
if (!it->m_uri.compare(uri)) {
|
145 |
ProtocolinfoEntry e;
|
149 |
ProtocolinfoEntry e;
|
146 |
if (!it->protoInfo(e)) {
|
150 |
if (!it->protoInfo(e)) {
|
147 |
LOGERR("checkContentFormat: resource has no protocolinfo\n");
|
151 |
LOGERR("checkContentFormat: resource has no protocolinfo\n");
|
148 |
return false;
|
152 |
return false;
|
149 |
}
|
153 |
}
|
150 |
string cf = e.contentFormat;
|
154 |
string cf = e.contentFormat;
|
151 |
if (g_supportedFormats.find(cf) == g_supportedFormats.end()) {
|
155 |
if (supportedformats.find(cf) == supportedformats.end()) { //
|
152 |
LOGERR("checkContentFormat: unsupported:: " << cf << endl);
|
156 |
LOGERR("checkContentFormat: unsupported:: " << cf << endl);
|
153 |
return false;
|
157 |
return false;
|
154 |
} else {
|
158 |
} else {
|
155 |
LOGDEB("checkContentFormat: supported: " << cf << endl);
|
159 |
LOGDEB("checkContentFormat: supported: " << cf << endl);
|
156 |
if (ups) {
|
160 |
if (ups) {
|