[vlc-commits] demux: hls: set non default ID on adaptsets
Francois Cartegnie
git at videolan.org
Wed Sep 27 18:04:46 CEST 2017
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Sep 27 17:34:47 2017 +0200| [4ee2be1f629f1eb2e6436c97388f9baa584a9ddb] | committer: Francois Cartegnie
demux: hls: set non default ID on adaptsets
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4ee2be1f629f1eb2e6436c97388f9baa584a9ddb
---
modules/demux/dash/mpd/IsoffMainParser.cpp | 2 +-
modules/demux/hls/playlist/Parser.cpp | 17 ++++++++++++++++-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/modules/demux/dash/mpd/IsoffMainParser.cpp b/modules/demux/dash/mpd/IsoffMainParser.cpp
index 7893f4c347..23d0e5e117 100644
--- a/modules/demux/dash/mpd/IsoffMainParser.cpp
+++ b/modules/demux/dash/mpd/IsoffMainParser.cpp
@@ -214,7 +214,7 @@ size_t IsoffMainParser::parseSegmentInformation(Node *node, SegmentInformation *
info->setTimescale(Integer<uint64_t>(node->getAttributeValue("timescale")));
if(node->hasAttribute("id"))
- info->setID(node->getAttributeValue("id"));
+ info->setID(ID(node->getAttributeValue("id")));
else
info->setID(ID((*nextid)++));
diff --git a/modules/demux/hls/playlist/Parser.cpp b/modules/demux/hls/playlist/Parser.cpp
index 050683c7aa..f58d733c46 100644
--- a/modules/demux/hls/playlist/Parser.cpp
+++ b/modules/demux/hls/playlist/Parser.cpp
@@ -443,6 +443,7 @@ M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std::
}
/* Finally add all groups */
+ unsigned set_id = 1;
std::map<std::string, AttributesTag *>::const_iterator groupsit;
for(groupsit = groupsmap.begin(); groupsit != groupsmap.end(); ++groupsit)
{
@@ -456,8 +457,22 @@ M3U8 * M3U8Parser::parse(vlc_object_t *p_object, stream_t *p_stream, const std::
altAdaptSet->addRepresentation(rep);
}
+ std::string desc;
+ if(pair.second->getAttributeByName("GROUP-ID"))
+ desc = pair.second->getAttributeByName("GROUP-ID")->quotedString();
if(pair.second->getAttributeByName("NAME"))
- altAdaptSet->description.Set(pair.second->getAttributeByName("NAME")->quotedString());
+ {
+ if(!desc.empty())
+ desc += " ";
+ desc += pair.second->getAttributeByName("NAME")->quotedString();
+ }
+
+ if(!desc.empty())
+ {
+ altAdaptSet->description.Set(desc);
+ altAdaptSet->setID(ID(desc));
+ }
+ else altAdaptSet->setID(ID(set_id++));
/* Subtitles unsupported for now */
if(pair.second->getAttributeByName("TYPE")->value != "AUDIO" &&
More information about the vlc-commits
mailing list