Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jean-Francois Dockes
upmpdcli
Commits
2273716d
Commit
2273716d
authored
Feb 18, 2017
by
Jean-Francois Dockes
Browse files
fix UpSong::didl() previous const bogus values
parent
893fd1a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/upmpdutils.cxx
View file @
2273716d
...
...
@@ -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
();
}
...
...
src/upmpdutils.hxx
View file @
2273716d
...
...
@@ -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
+
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment