Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC
Commits:
7367f53b by François Cartegnie at 2024-07-08T14:43:38+00:00
demux: adaptive: fix start with indexes only
refs #28683
(cherry picked from commit 9f9c466bc14c1dcd75564c7cd18d031ea9e76325)
- - - - -
2 changed files:
- modules/demux/adaptive/SegmentTracker.cpp
- modules/demux/adaptive/Streams.cpp
Changes:
=====================================
modules/demux/adaptive/SegmentTracker.cpp
=====================================
@@ -296,7 +296,7 @@ SegmentTracker::prepareChunk(bool switch_allowed, Position
pos) const
bool b_gap = true;
ISegment *datasegment = pos.rep->getNextMediaSegment(pos.number,
&pos.number, &b_gap);
- if(!datasegment)
+ if(!datasegment && (!pos.rep->needsIndex() || pos.index_sent))
return ChunkEntry();
ISegment *segment = nullptr;
@@ -322,12 +322,12 @@ SegmentTracker::prepareChunk(bool switch_allowed,
Position pos) const
if(!segmentChunk)
return ChunkEntry();
- if(segment != datasegment) /* need to set for init */
+ if(segment != datasegment && datasegment) /* need to set for init */
segmentChunk->discontinuitySequenceNumber =
datasegment->getDiscontinuitySequenceNumber();
vlc_tick_t startTime = VLC_TICK_INVALID;
vlc_tick_t duration = 0;
- vlc_tick_t displayTime = datasegment->getDisplayTime();
+ vlc_tick_t displayTime = datasegment ? datasegment->getDisplayTime() :
VLC_TICK_INVALID;
/* timings belong to timeline and are not set on the segment or need
profile timescale */
if(pos.rep->getPlaybackTimeDurationBySegmentNumber(pos.number, &startTime,
&duration))
startTime += VLC_TICK_0;
=====================================
modules/demux/adaptive/Streams.cpp
=====================================
@@ -625,11 +625,14 @@ ChunkInterface * AbstractStream::getNextChunk() const
{
const bool b_restarting = fakeEsOut()->restarting();
ChunkInterface *ck = segmentTracker->getNextChunk(!b_restarting);
+
if(ck && !fakeEsOut()->hasSegmentStartTimes())
fakeEsOut()->setSegmentStartTimes(startTimeContext);
if(ck && !fakeEsOut()->hasSynchronizationReference())
{
+ if(!fakeEsOut()->hasSegmentStartTimes())
+ return ck;
assert(fakeEsOut()->hasSegmentStartTimes());
SynchronizationReference r;
if(segmentTracker->getSynchronizationReference(currentSequence,
startTimeContext.media, r))
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/commit/7367f53b56011f87069a4529ae7e1baa6a4f2275
--
View it on GitLab:
https://code.videolan.org/videolan/vlc/-/commit/7367f53b56011f87069a4529ae7e1baa6a4f2275
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits