[vlc-commits] demux: hls: workaround failed update loops
Francois Cartegnie
git at videolan.org
Sun Apr 5 20:39:24 CEST 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Apr 5 20:36:57 2020 +0200| [46ff0e4ec29ffbf946c148786fcc487ea7982753] | committer: Francois Cartegnie
demux: hls: workaround failed update loops
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=46ff0e4ec29ffbf946c148786fcc487ea7982753
---
modules/demux/hls/playlist/Representation.cpp | 9 ++++++---
modules/demux/hls/playlist/Representation.hpp | 1 +
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/modules/demux/hls/playlist/Representation.cpp b/modules/demux/hls/playlist/Representation.cpp
index d09845473f..9124e5ade2 100644
--- a/modules/demux/hls/playlist/Representation.cpp
+++ b/modules/demux/hls/playlist/Representation.cpp
@@ -42,6 +42,7 @@ Representation::Representation ( BaseAdaptationSet *set ) :
{
b_live = true;
b_loaded = false;
+ b_failed = false;
nextUpdateTime = 0;
targetDuration = 0;
streamFormat = StreamFormat::UNKNOWN;
@@ -133,7 +134,7 @@ void Representation::scheduleNextUpdate(uint64_t number)
bool Representation::needsUpdate() const
{
- return !b_loaded || (isLive() && nextUpdateTime < time(NULL));
+ return !b_failed && (!b_loaded || (isLive() && nextUpdateTime < time(NULL)));
}
bool Representation::runLocalUpdates(SharedResources *res)
@@ -143,8 +144,10 @@ bool Representation::runLocalUpdates(SharedResources *res)
if(!b_loaded || (isLive() && nextUpdateTime < now))
{
M3U8Parser parser(res);
- parser.appendSegmentsFromPlaylistURI(playlist->getVLCObject(), this);
- b_loaded = true;
+ if(!parser.appendSegmentsFromPlaylistURI(playlist->getVLCObject(), this))
+ b_failed = true;
+ else
+ b_loaded = true;
return true;
}
diff --git a/modules/demux/hls/playlist/Representation.hpp b/modules/demux/hls/playlist/Representation.hpp
index 8659fe245b..8446750f86 100644
--- a/modules/demux/hls/playlist/Representation.hpp
+++ b/modules/demux/hls/playlist/Representation.hpp
@@ -57,6 +57,7 @@ namespace hls
StreamFormat streamFormat;
bool b_live;
bool b_loaded;
+ bool b_failed;
time_t nextUpdateTime;
time_t targetDuration;
Url playlistUrl;
More information about the vlc-commits
mailing list