vlc | branch: master | Francois Cartegnie <[email protected]> | Sun Sep 11 
18:53:30 2016 +0200| [7f656d00cbfc04b60844c7188729dffc4f3c19aa] | committer: 
Francois Cartegnie

demux: adaptive: ensure representation when querying time

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

 modules/demux/adaptive/SegmentTracker.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/demux/adaptive/SegmentTracker.cpp 
b/modules/demux/adaptive/SegmentTracker.cpp
index 7ce4c1d..9a66569 100644
--- a/modules/demux/adaptive/SegmentTracker.cpp
+++ b/modules/demux/adaptive/SegmentTracker.cpp
@@ -278,8 +278,13 @@ void SegmentTracker::setPositionByNumber(uint64_t 
segnumber, bool restarted)
 mtime_t SegmentTracker::getPlaybackTime() const
 {
     mtime_t time, duration;
-    if(curRepresentation &&
-       curRepresentation->getPlaybackTimeDurationBySegmentNumber(next, &time, 
&duration))
+
+    BaseRepresentation *rep = curRepresentation;
+    if(!rep)
+        rep = logic->getNextRepresentation(adaptationSet, NULL);
+
+    if(rep &&
+       rep->getPlaybackTimeDurationBySegmentNumber(next, &time, &duration))
     {
         return time;
     }

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to