We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e8fc3f commit 5f4bc11Copy full SHA for 5f4bc11
src/parser/DASHTree.cpp
@@ -1826,8 +1826,15 @@ void adaptive::CDashTree::GenerateTemplatedSegments(PLAYLIST::CSegmentTemplate&
1826
const uint64_t timeEnd = wndEnd * segTimescale / 1000;
1827
1828
// Create segments within time window
1829
- while (time + segDuration <= timeEnd && segNumber <= segNumberEnd)
+ while (time < timeEnd && segNumber <= segNumberEnd)
1830
{
1831
+ const uint64_t remainingDur = timeEnd - time;
1832
+ uint64_t duration = segDuration;
1833
+
1834
+ // Allow segment with partial duration for the end of stream
1835
+ if (remainingDur < duration && !m_isLive)
1836
+ duration = remainingDur;
1837
1838
CSegment seg;
1839
seg.startPTS_ = time;
1840
seg.m_endPts = time + segDuration;
0 commit comments