[vlc-commits] demux: hls: remove double update need check
Francois Cartegnie
git at videolan.org
Thu May 14 10:18:47 CEST 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed May 13 17:48:02 2020 +0200| [1495929d2f0da78c79cc80e8b0e427eaf310794e] | committer: Francois Cartegnie
demux: hls: remove double update need check
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1495929d2f0da78c79cc80e8b0e427eaf310794e
---
modules/demux/hls/playlist/Representation.cpp | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/modules/demux/hls/playlist/Representation.cpp b/modules/demux/hls/playlist/Representation.cpp
index 9124e5ade2..ba410c38f2 100644
--- a/modules/demux/hls/playlist/Representation.cpp
+++ b/modules/demux/hls/playlist/Representation.cpp
@@ -33,6 +33,7 @@
#include "../../adaptive/playlist/SegmentList.h"
#include <ctime>
+#include <cassert>
using namespace hls;
using namespace hls::playlist;
@@ -139,19 +140,13 @@ bool Representation::needsUpdate() const
bool Representation::runLocalUpdates(SharedResources *res)
{
- const time_t now = time(NULL);
AbstractPlaylist *playlist = getPlaylist();
- if(!b_loaded || (isLive() && nextUpdateTime < now))
- {
- M3U8Parser parser(res);
- if(!parser.appendSegmentsFromPlaylistURI(playlist->getVLCObject(), this))
- b_failed = true;
- else
- b_loaded = true;
-
- return true;
- }
-
+ assert(needsUpdate());
+ M3U8Parser parser(res);
+ if(!parser.appendSegmentsFromPlaylistURI(playlist->getVLCObject(), this))
+ b_failed = true;
+ else
+ b_loaded = true;
return true;
}
More information about the vlc-commits
mailing list