From ec75b625109052b3571d4df89045f06f5843066b Mon Sep 17 00:00:00 2001 From: CastagnaIT Date: Sat, 26 Aug 2023 15:22:39 +0200 Subject: [PATCH] [HLSTree] Ensure repr baseurl is set between periods --- src/parser/HLSTree.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/parser/HLSTree.cpp b/src/parser/HLSTree.cpp index a3eb53083..e67e85f5d 100644 --- a/src/parser/HLSTree.cpp +++ b/src/parser/HLSTree.cpp @@ -489,11 +489,17 @@ PLAYLIST::PrepareRepStatus adaptive::CHLSTree::prepareRepresentation(PLAYLIST::C m_periods.push_back(std::move(newPeriod)); } else + { + // Period(s) already created by a previously downloaded manifest child period = m_periods[discontCount].get(); + } newStartNumber += rep->SegmentTimeline().GetSize(); adp = period->GetAdaptationSets()[adpSetPos].get(); - rep = adp->GetRepresentations()[reprPos].get(); + // When we switch to a repr of another period we need to set current base url + CRepresentation* switchRep = adp->GetRepresentations()[reprPos].get(); + switchRep->SetBaseUrl(rep->GetBaseUrl()); + rep = switchRep; currentSegStartPts = 0;