[vlc-commits] demux: hls: parse Role
Francois Cartegnie
git at videolan.org
Fri May 17 20:34:58 CEST 2019
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed May 15 10:17:15 2019 +0200| [eac20702ebfb364c3c1ecec83d044bf1d804499e] | committer: Francois Cartegnie
demux: hls: parse Role
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eac20702ebfb364c3c1ecec83d044bf1d804499e
---
modules/demux/hls/playlist/Parser.cpp | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/modules/demux/hls/playlist/Parser.cpp b/modules/demux/hls/playlist/Parser.cpp
index 9e990d9c3f..d1fdd8e478 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -502,10 +502,28 @@ M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std::
}
else altAdaptSet->setID(ID(set_id++));
+ if(pair.second->getAttributeByName("DEFAULT"))
+ {
+ if(pair.second->getAttributeByName("DEFAULT")->value == "YES")
+ altAdaptSet->setRole(Role(Role::MAIN));
+ else
+ altAdaptSet->setRole(Role(Role::ALTERNATE));
+ }
+
+ if(pair.second->getAttributeByName("AUTOSELECT"))
+ {
+ if(pair.second->getAttributeByName("AUTOSELECT")->value == "NO" &&
+ !pair.second->getAttributeByName("DEFAULT"))
+ altAdaptSet->setRole(Role(Role::SUPPLEMENTARY));
+ }
+
/* Subtitles unsupported for now */
- if(pair.second->getAttributeByName("TYPE")->value != "AUDIO" &&
- pair.second->getAttributeByName("TYPE")->value != "VIDEO" &&
- pair.second->getAttributeByName("TYPE")->value != "SUBTITLES" )
+ const Attribute *typeattr = pair.second->getAttributeByName("TYPE");
+ if(typeattr->value == "SUBTITLES")
+ {
+ altAdaptSet->setRole(Role(Role::SUBTITLE));
+ }
+ else if(typeattr->value != "AUDIO" && typeattr->value != "VIDEO")
{
rep->streamFormat = StreamFormat(StreamFormat::UNSUPPORTED);
}
More information about the vlc-commits
mailing list