[vlc-commits] demux: hls: remove double update need check
Francois Cartegnie
git at videolan.org
Thu May 14 15:30:18 CEST 2020
vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed May 13 17:48:02 2020 +0200| [4a6839244471b01fe5618ed12d678208f308c3cc] | committer: Francois Cartegnie
demux: hls: remove double update need check
(cherry picked from commit 1495929d2f0da78c79cc80e8b0e427eaf310794e)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=4a6839244471b01fe5618ed12d678208f308c3cc
---
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 118545b538..f82d5bc662 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