aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-10 21:01:45 +0100
committerMax Kellermann <max@duempel.org>2014-01-10 22:57:22 +0100
commit040a5ddad53ece9803d71972cb33d01a8afb7ad6 (patch)
treec1dd498137b1b15dab655e9dfffa7c5826476e51 /src
parente7eb04954d79955201316a91c72aabcfc724297f (diff)
downloadmpd-040a5ddad53ece9803d71972cb33d01a8afb7ad6.tar.gz
mpd-040a5ddad53ece9803d71972cb33d01a8afb7ad6.tar.xz
mpd-040a5ddad53ece9803d71972cb33d01a8afb7ad6.zip
db/upnp/Directory: move "res" tag handler to StartElement()
No need to handle this in EndElement() - in StartElement(), we already have all we need.
Diffstat (limited to '')
-rw-r--r--src/db/upnp/Directory.cxx28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/db/upnp/Directory.cxx b/src/db/upnp/Directory.cxx
index 1ae72b107..81e01f216 100644
--- a/src/db/upnp/Directory.cxx
+++ b/src/db/upnp/Directory.cxx
@@ -86,6 +86,7 @@ protected:
m_tobj.m_pid = m_path.back().attributes["parentID"];
}
break;
+
case 'i':
if (!strcmp(name, "item")) {
m_tobj.clear();
@@ -94,7 +95,21 @@ protected:
m_tobj.m_pid = m_path.back().attributes["parentID"];
}
break;
- default:
+
+ case 'r':
+ if (!strcmp(name, "res")) {
+ // <res protocolInfo="http-get:*:audio/mpeg:*" size="5171496"
+ // bitrate="24576" duration="00:03:35" sampleFrequency="44100"
+ // nrAudioChannels="2">
+ std::string s;
+ s="protocolInfo";m_tobj.m_props[s] = m_path.back().attributes[s];
+ s="size";m_tobj.m_props[s] = m_path.back().attributes[s];
+ s="bitrate";m_tobj.m_props[s] = m_path.back().attributes[s];
+ s="duration";m_tobj.m_props[s] = m_path.back().attributes[s];
+ s="sampleFrequency";m_tobj.m_props[s] = m_path.back().attributes[s];
+ s="nrAudioChannels";m_tobj.m_props[s] = m_path.back().attributes[s];
+ }
+
break;
}
}
@@ -135,17 +150,6 @@ protected:
if (checkobjok()) {
m_dir.m_items.push_back(m_tobj);
}
- } else if (!strcmp(name, "res")) {
- // <res protocolInfo="http-get:*:audio/mpeg:*" size="5171496"
- // bitrate="24576" duration="00:03:35" sampleFrequency="44100"
- // nrAudioChannels="2">
- std::string s;
- s="protocolInfo";m_tobj.m_props[s] = m_path.back().attributes[s];
- s="size";m_tobj.m_props[s] = m_path.back().attributes[s];
- s="bitrate";m_tobj.m_props[s] = m_path.back().attributes[s];
- s="duration";m_tobj.m_props[s] = m_path.back().attributes[s];
- s="sampleFrequency";m_tobj.m_props[s] = m_path.back().attributes[s];
- s="nrAudioChannels";m_tobj.m_props[s] = m_path.back().attributes[s];
}
m_path.pop_back();