From a40b7be426025b00c2e5fd1ee9969176755e18da Mon Sep 17 00:00:00 2001 From: CastagnaIT Date: Fri, 1 Nov 2024 08:25:56 +0100 Subject: [PATCH] [HLSTree] Fix misaligned periods update for VOD --- src/parser/HLSTree.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/parser/HLSTree.cpp b/src/parser/HLSTree.cpp index dee9a9c6a..99a70e47f 100644 --- a/src/parser/HLSTree.cpp +++ b/src/parser/HLSTree.cpp @@ -447,6 +447,14 @@ bool adaptive::CHLSTree::ProcessChildManifest(PLAYLIST::CPeriod* period, size_t adpSetPos = GetPtrPosition(period->GetAdaptationSets(), adp); size_t reprPos = GetPtrPosition(adp->GetRepresentations(), rep); + if (!m_isLive) + { + // VOD streaming must be updated always from the first period + period = m_periods[0].get(); + adp = period->GetAdaptationSets()[adpSetPos].get(); + rep = adp->GetRepresentations()[reprPos].get(); + } + rep->SetBaseUrl(sourceUrl); EncryptionType currentEncryptionType = EncryptionType::NONE;