Commit 2273716d authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

fix UpSong::didl() previous const bogus values

parent 893fd1a3
......@@ -161,14 +161,13 @@ string UpSong::didl()
UPNPXML(album, upnp:album);
UPNPXML(tracknum, upnp:originalTrackNumber);
string sfs = SoapHelp::i2s((samplefreq == 0 ? 44100 : samplefreq));
string lmime((mime.empty() ? "audio/mpeg" : mime));
ss << "<res " <<
"duration=\"" << upnpduration(duration_secs * 1000) << "\" " <<
"sampleFrequency=\"" << sfs << "\" " <<
"audioChannels=\"2\" " <<
"protocolInfo=\"http-get:*:" << lmime << ":*\"" << ">" <<
"size=\"" << lltodecstr(size) << "\" " <<
"bitrate=\"" << SoapHelp::i2s(bitrate) << "\" " <<
"sampleFrequency=\"" << SoapHelp::i2s(samplefreq) << "\" " <<
"nrAudioChannels=\"" << SoapHelp::i2s(channels) << "\" " <<
"protocolInfo=\"http-get:*:" << mime << ":* " << "\" >"<<
SoapHelp::xmlQuote(uri) <<
"</res>";
}
......@@ -176,6 +175,7 @@ string UpSong::didl()
UPNPXML(artist, upnp:artist);
UPNPXML(artUri, upnp:albumArtURI);
ss << "</" << typetag << ">";
LOGDEB("UpSong::didl(): " << ss.str() << endl);
return ss.str();
}
......
......@@ -30,9 +30,7 @@ namespace UPnPClient {
// to general purpose track/container descriptor
class UpSong {
public:
UpSong()
: duration_secs(0), bitrate(0), samplefreq(0), mpdid(0),
iscontainer(false), searchable(false) {
UpSong() {
}
void clear() {
*this = UpSong();
......@@ -48,15 +46,17 @@ public:
std::string genre;
std::string artUri;
std::string upnpClass;
std::string mime;
std::string mime{"audio/mpeg"};
unsigned int duration_secs;
unsigned int bitrate;
unsigned int samplefreq;
int duration_secs{0};
int64_t size{0};
int bitrate{192000};
int samplefreq{44100};
int channels{2};
int mpdid;
bool iscontainer;
bool searchable;
int mpdid{0};
bool iscontainer{false};
bool searchable{false};
std::string dump() {
return std::string("class [" + upnpClass + "] Artist [" + artist +
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment