[vlc-commits] demux: adaptative: Ensure having a representation on setPosition
Francois Cartegnie
git at videolan.org
Tue Nov 10 11:17:42 CET 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Nov 9 14:54:28 2015 +0100| [cc1a3576ba60d6044108cc25d9b9d3e4b71a51cb] | committer: Francois Cartegnie
demux: adaptative: Ensure having a representation on setPosition
Recent changes deselects representation on stream deactivation.
But setPosition requires representation when reactivating a stream.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cc1a3576ba60d6044108cc25d9b9d3e4b71a51cb
---
modules/demux/adaptative/SegmentTracker.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/demux/adaptative/SegmentTracker.cpp b/modules/demux/adaptative/SegmentTracker.cpp
index 07717f1..85cd902 100644
--- a/modules/demux/adaptative/SegmentTracker.cpp
+++ b/modules/demux/adaptative/SegmentTracker.cpp
@@ -148,8 +148,12 @@ SegmentChunk * SegmentTracker::getNextChunk(bool switch_allowed, HTTPConnectionM
bool SegmentTracker::setPositionByTime(mtime_t time, bool restarted, bool tryonly)
{
uint64_t segnumber;
- if(prevRepresentation &&
- prevRepresentation->getSegmentNumberByTime(time, &segnumber))
+ BaseRepresentation *rep = prevRepresentation;
+ if(!rep)
+ rep = logic->getNextRepresentation(adaptationSet, NULL);
+
+ if(rep &&
+ rep->getSegmentNumberByTime(time, &segnumber))
{
if(!tryonly)
setPositionByNumber(segnumber, restarted);
More information about the vlc-commits
mailing list