[vlc-commits] demux: smooth: add missing language
Francois Cartegnie
git at videolan.org
Mon Nov 9 11:04:51 CET 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 5 20:38:42 2015 +0100| [e0746a1f85542a0a8d37813b77050242f780822c] | committer: Francois Cartegnie
demux: smooth: add missing language
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e0746a1f85542a0a8d37813b77050242f780822c
---
modules/demux/smooth/playlist/ForgedInitSegment.cpp | 8 ++++++++
modules/demux/smooth/playlist/ForgedInitSegment.hpp | 2 ++
modules/demux/smooth/playlist/Parser.cpp | 5 +++++
3 files changed, 15 insertions(+)
diff --git a/modules/demux/smooth/playlist/ForgedInitSegment.cpp b/modules/demux/smooth/playlist/ForgedInitSegment.cpp
index 1411f79..f239f30 100644
--- a/modules/demux/smooth/playlist/ForgedInitSegment.cpp
+++ b/modules/demux/smooth/playlist/ForgedInitSegment.cpp
@@ -199,6 +199,11 @@ void ForgedInitSegment::setFourCC(const std::string &fcc)
}
}
+void ForgedInitSegment::setLanguage(const std::string &lang)
+{
+ language = lang;
+}
+
block_t * ForgedInitSegment::buildMoovBox()
{
mp4mux_trackinfo_t trackinfo;
@@ -264,6 +269,9 @@ block_t * ForgedInitSegment::buildMoovBox()
break;
}
+ if(!language.empty())
+ trackinfo.fmt.psz_language = strdup(language.c_str());
+
mp4mux_trackinfo_t *p_tracks = &trackinfo;
bo_t *box = GetMoovBox(NULL, &p_tracks, 1, true, false, false, false);
mp4mux_trackinfo_Clear(&trackinfo);
diff --git a/modules/demux/smooth/playlist/ForgedInitSegment.hpp b/modules/demux/smooth/playlist/ForgedInitSegment.hpp
index dfbc76d..4eb6c51 100644
--- a/modules/demux/smooth/playlist/ForgedInitSegment.hpp
+++ b/modules/demux/smooth/playlist/ForgedInitSegment.hpp
@@ -53,6 +53,7 @@ namespace smooth
void setFourCC(const std::string &);
void setAudioTag(uint16_t);
void setTrackID(unsigned);
+ void setLanguage(const std::string &);
protected:
virtual SegmentChunk * getChunk(const std::string &, HTTPConnectionManager *); /* reimpl */
@@ -63,6 +64,7 @@ namespace smooth
block_t * buildMoovBox();
std::string data;
std::string type;
+ std::string language;
uint8_t *extradata;
size_t i_extradata;
WAVEFORMATEX formatex;
diff --git a/modules/demux/smooth/playlist/Parser.cpp b/modules/demux/smooth/playlist/Parser.cpp
index 8d2c2ea..5e2cfee 100644
--- a/modules/demux/smooth/playlist/Parser.cpp
+++ b/modules/demux/smooth/playlist/Parser.cpp
@@ -167,6 +167,9 @@ static void ParseQualityLevel(BaseAdaptationSet *adaptSet, Node *qualNode, const
{
initSegment->setTrackID(trackid);
+ if(!adaptSet->getLang().empty())
+ initSegment->setLanguage(adaptSet->getLang().front());
+
if(rep->getWidth() > 0 && rep->getHeight() > 0)
initSegment->setVideoSize(rep->getWidth(), rep->getHeight());
@@ -210,6 +213,8 @@ static void ParseStreamIndex(BasePeriod *period, Node *streamIndexNode, unsigned
if(adaptSet)
{
adaptSet->setID(ID(id));
+ if(streamIndexNode->hasAttribute("Language"))
+ adaptSet->addLang(streamIndexNode->getAttributeValue("Language"));
const std::string url = streamIndexNode->getAttributeValue("Url");
if(!url.empty())
{
More information about the vlc-commits
mailing list