Commit e0746a1f authored by François Cartegnie's avatar François Cartegnie 🤞

demux: smooth: add missing language

parent 9031edac
......@@ -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);
......
......@@ -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;
......
......@@ -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())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment