[vlc-commits] demux: adaptive: fix negative livestart number
Francois Cartegnie
git at videolan.org
Thu Nov 26 21:36:58 CET 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Nov 26 21:07:39 2020 +0100| [a0d053d40295be6c30cbe023a460865ffd3b2f83] | committer: Francois Cartegnie
demux: adaptive: fix negative livestart number
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a0d053d40295be6c30cbe023a460865ffd3b2f83
---
modules/demux/adaptive/logic/BufferingLogic.cpp | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/modules/demux/adaptive/logic/BufferingLogic.cpp b/modules/demux/adaptive/logic/BufferingLogic.cpp
index 8787ce5122..f11fac2377 100644
--- a/modules/demux/adaptive/logic/BufferingLogic.cpp
+++ b/modules/demux/adaptive/logic/BufferingLogic.cpp
@@ -302,11 +302,14 @@ uint64_t DefaultBufferingLogic::getLiveStartSegmentNumber(BaseRepresentation *re
uint64_t safeedgenumber = back->getSequenceNumber() -
std::min((uint64_t)list.size() - 1,
(uint64_t)SAFETY_BUFFERING_EDGE_OFFSET);
-
uint64_t safestartnumber = availableliststartnumber;
- if(safeedgenumber > safestartnumber)
- safestartnumber -= std::min(safeedgenumber-safestartnumber - 1,
- (uint64_t)SAFETY_EXPURGING_OFFSET);
+
+ for(unsigned i=0; i<SAFETY_EXPURGING_OFFSET; i++)
+ {
+ if(safestartnumber + 1 >= safeedgenumber)
+ break;
+ safestartnumber++;
+ }
stime_t maxbufferizable = 0;
stime_t safeedgeduration = 0;
More information about the vlc-commits
mailing list