[vlc-commits] demux: dash: handle infinite repeat in timeline

Francois Cartegnie git at videolan.org
Tue Mar 12 07:32:51 CET 2019


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 23 13:12:40 2019 +0100| [534833c685f7e959bb6e777f7a20413b141e2ea6] | committer: Jean-Baptiste Kempf

demux: dash: handle infinite repeat in timeline

no spec... guessing

(cherry picked from commit 0d6a31dcdae08457c666172023acd7b72e128e4c)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=534833c685f7e959bb6e777f7a20413b141e2ea6
---

 modules/demux/dash/mpd/IsoffMainParser.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/demux/dash/mpd/IsoffMainParser.cpp b/modules/demux/dash/mpd/IsoffMainParser.cpp
index 0401d1bf98..1426a38cae 100644
--- a/modules/demux/dash/mpd/IsoffMainParser.cpp
+++ b/modules/demux/dash/mpd/IsoffMainParser.cpp
@@ -45,6 +45,7 @@
 #include "../adaptive/tools/Conversions.hpp"
 #include <vlc_stream.h>
 #include <cstdio>
+#include <limits>
 
 using namespace dash::mpd;
 using namespace adaptive::xml;
@@ -463,9 +464,13 @@ void IsoffMainParser::parseTimeline(Node *node, MediaSegmentTemplate *templ)
             if(!s->hasAttribute("d")) /* Mandatory */
                 continue;
             stime_t d = Integer<stime_t>(s->getAttributeValue("d"));
-            uint64_t r = 0; // never repeats by default
+            int64_t r = 0; // never repeats by default
             if(s->hasAttribute("r"))
-                r = Integer<uint64_t>(s->getAttributeValue("r"));
+            {
+                r = Integer<int64_t>(s->getAttributeValue("r"));
+                if(r < 0)
+                    r = std::numeric_limits<unsigned>::max();
+            }
 
             if(s->hasAttribute("t"))
             {



More information about the vlc-commits mailing list