Commit cc1a3576 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptative: Ensure having a representation on setPosition

Recent changes deselects representation on stream deactivation.
But setPosition requires representation when reactivating a stream.
parent 949032db
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment