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

Francois Cartegnie git at videolan.org
Wed Jan 23 13:14:28 CET 2019


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 23 13:12:40 2019 +0100| [0d6a31dcdae08457c666172023acd7b72e128e4c] | committer: Francois Cartegnie

demux: dash: handle infinite repeat in timeline

no spec... guessing

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0d6a31dcdae08457c666172023acd7b72e128e4c
---

 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 a86d10afd7..42baf0381a 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;
@@ -461,9 +462,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