[vlc-commits] demux: dash: handle profiles list
Francois Cartegnie
git at videolan.org
Fri Dec 19 14:17:40 CET 2014
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Dec 19 14:12:47 2014 +0100| [2a212f7daabb7c640cd2e541163f57045dfe247f] | committer: Francois Cartegnie
demux: dash: handle profiles list
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2a212f7daabb7c640cd2e541163f57045dfe247f
---
modules/stream_filter/dash/xml/DOMParser.cpp | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/modules/stream_filter/dash/xml/DOMParser.cpp b/modules/stream_filter/dash/xml/DOMParser.cpp
index e9d34f0..447e14f 100644
--- a/modules/stream_filter/dash/xml/DOMParser.cpp
+++ b/modules/stream_filter/dash/xml/DOMParser.cpp
@@ -166,12 +166,24 @@ bool DOMParser::isDash (stream_t *stream)
Profile DOMParser::getProfile() const
{
+ Profile res(Profile::Unknown);
if(this->root == NULL)
- return Profile(Profile::Unknown);
+ return res;
std::string urn = this->root->getAttributeValue("profiles");
if ( urn.length() == 0 )
urn = this->root->getAttributeValue("profile"); //The standard spells it the both ways...
- return Profile(urn);
+
+ size_t pos;
+ size_t nextpos = -1;
+ do
+ {
+ pos = nextpos + 1;
+ nextpos = urn.find_first_of(",", pos);
+ res = Profile(urn.substr(pos, nextpos - pos));
+ }
+ while (nextpos != std::string::npos && res == Profile::Unknown);
+
+ return res;
}
More information about the vlc-commits
mailing list