[vlc-commits] [Git][videolan/vlc][3.0.x] demux: adaptive: fix relative merge last segment duplication
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Wed Apr 6 14:11:07 UTC 2022
Jean-Baptiste Kempf pushed to branch 3.0.x at VideoLAN / VLC
Commits:
cb39c3b5 by Francois Cartegnie at 2022-04-04T18:12:56+02:00
demux: adaptive: fix relative merge last segment duplication
(cherry picked from commit 95f144cec26b2751bc2b5a5bcdbd26730ee2f207)
- - - - -
2 changed files:
- modules/demux/adaptive/playlist/SegmentList.cpp
- modules/demux/adaptive/test/playlist/SegmentList.cpp
Changes:
=====================================
modules/demux/adaptive/playlist/SegmentList.cpp
=====================================
@@ -116,7 +116,7 @@ void SegmentList::updateWith(AbstractMultipleSegmentBaseType *updated_,
const uint64_t oldest = updated->segments.front()->getSequenceNumber();
/* filter out known segments from the update */
- updated->pruneBySegmentNumber(prevSegment->getSequenceNumber());
+ updated->pruneBySegmentNumber(prevSegment->getSequenceNumber() + 1);
if(updated->segments.empty())
return;
=====================================
modules/demux/adaptive/test/playlist/SegmentList.cpp
=====================================
@@ -173,6 +173,38 @@ int SegmentList_test()
delete segmentList2;
segmentList2 = nullptr;
+ /* overlapping updates, relative timings */
+ segmentList = new SegmentList(nullptr, true);
+ segmentList->addAttribute(new TimescaleAttr(timescale));
+ segmentList->addAttribute(new DurationAttr(100));
+ Expect(segmentList->inheritDuration());
+ for(int i=0; i<2; i++)
+ {
+ seg = new Segment(nullptr);
+ seg->setSequenceNumber(123 + i);
+ seg->startTime.Set(START + 100 * i);
+ seg->duration.Set(100);
+ segmentList->addSegment(seg);
+ }
+ segmentList2 = new SegmentList(nullptr, true);
+ for(int i=0; i<3; i++)
+ {
+ seg = new Segment(nullptr);
+ seg->setSequenceNumber(123 + i);
+ seg->startTime.Set(START + 100 * i);
+ seg->duration.Set(100);
+ segmentList2->addSegment(seg);
+ }
+ segmentList->updateWith(segmentList2);
+ Expect(segmentList->getSegments().size() == 3);
+ Expect(segmentList->getSegments().at(0)->getSequenceNumber() == 123);
+ Expect(segmentList->getSegments().at(1)->getSequenceNumber() == 124);
+ Expect(segmentList->getSegments().at(2)->getSequenceNumber() == 125);
+
+ delete segmentList;
+ delete segmentList2;
+ segmentList2 = nullptr;
+
/* gap updates, absolute media timings */
segmentList = new SegmentList(nullptr, false);
segmentList->addAttribute(new TimescaleAttr(timescale));
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cb39c3b56d314120aa86a4402a1d013c432f487f
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/cb39c3b56d314120aa86a4402a1d013c432f487f
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list