[vlc-commits] demux: dash: create virtual segment for subtitles

Francois Cartegnie git at videolan.org
Tue Sep 22 00:38:49 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Sep 11 10:57:03 2015 +0200| [cc0304ca28b134ca731a181cb186ae98ae41cfed] | committer: Francois Cartegnie

demux: dash: create virtual segment for subtitles

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

 modules/demux/dash/mpd/IsoffMainParser.cpp |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/modules/demux/dash/mpd/IsoffMainParser.cpp b/modules/demux/dash/mpd/IsoffMainParser.cpp
index d39a82d..8b290c1 100644
--- a/modules/demux/dash/mpd/IsoffMainParser.cpp
+++ b/modules/demux/dash/mpd/IsoffMainParser.cpp
@@ -32,6 +32,7 @@
 #include "../adaptative/playlist/SegmentBase.h"
 #include "../adaptative/playlist/SegmentList.h"
 #include "../adaptative/playlist/SegmentTimeline.h"
+#include "../adaptative/playlist/SegmentInformation.hpp"
 #include "MPD.h"
 #include "Representation.h"
 #include "Period.h"
@@ -298,7 +299,16 @@ void    IsoffMainParser::setRepresentations (Node *adaptationSetNode, Adaptation
             }
         }
 
-        parseSegmentInformation(repNode, currentRepresentation);
+        size_t i_total = parseSegmentInformation(repNode, currentRepresentation);
+        /* Empty Representation with just baseurl (ex: subtitles) */
+        if(i_total == 0 &&
+           (currentRepresentation->baseUrl.Get() && !currentRepresentation->baseUrl.Get()->empty()) &&
+            adaptationSet->getSegment(SegmentInformation::INFOTYPE_MEDIA, 0) == NULL)
+        {
+            SegmentBase *base = new (std::nothrow) SegmentBase(currentRepresentation);
+            if(base)
+                currentRepresentation->setSegmentBase(base);
+        }
 
         adaptationSet->addRepresentation(currentRepresentation);
     }



More information about the vlc-commits mailing list