From c73601e7b10d435c934c66ee5661673fc366fa07 Mon Sep 17 00:00:00 2001 From: Francois Cartegnie Date: Wed, 20 Oct 2021 10:53:27 +0200 Subject: [PATCH] demux: adaptive: sent discontinuity once with init --- modules/demux/adaptive/SegmentTracker.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/demux/adaptive/SegmentTracker.cpp b/modules/demux/adaptive/SegmentTracker.cpp index e592868668..9074b9110a 100644 --- a/modules/demux/adaptive/SegmentTracker.cpp +++ b/modules/demux/adaptive/SegmentTracker.cpp @@ -356,7 +356,12 @@ ChunkInterface * SegmentTracker::getNextChunk(bool switch_allowed, /* here next == wanted chunk pos */ bool b_gap = (next.number != chunk.pos.number); const bool b_switched = (next.rep != chunk.pos.rep); - const bool b_discontinuity = chunk.chunk->discontinuity && current.isValid(); + bool b_discontinuity = chunk.chunk->discontinuity && current.isValid(); + if(b_discontinuity && current.number == next.number) + { + /* if we are on the same segment and indexes have been sent, then discontinuity was */ + b_discontinuity = false; + } if(b_switched) {