Commit 4dd676f9 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptive: add always restart demuxers for webvtt

because we really can't feed getLine's 2K peeks.
parent 7b02ea0a
......@@ -588,6 +588,15 @@ void AbstractStream::trackerEvent(const SegmentTrackerEvent &event)
{
needrestart = true;
}
break;
case SegmentTrackerEvent::SEGMENT_CHANGE:
if(demuxer && demuxer->needsRestartOnEachSegment() && !inrestart)
{
needrestart = true;
}
break;
default:
break;
}
......
......@@ -54,11 +54,21 @@ bool AbstractDemuxer::needsRestartOnSwitch() const
return !b_candetectswitches;
}
bool AbstractDemuxer::needsRestartOnEachSegment() const
{
return b_alwaysrestarts;
}
void AbstractDemuxer::setCanDetectSwitches( bool b )
{
b_candetectswitches = b;
}
void AbstractDemuxer::setRestartsOnEachSegment( bool b )
{
b_alwaysrestarts = b;
}
bool AbstractDemuxer::needsRestartOnSeek() const
{
return b_reinitsonseek;
......
......@@ -39,11 +39,14 @@ namespace adaptive
bool alwaysStartsFromZero() const;
bool needsRestartOnSeek() const;
bool needsRestartOnSwitch() const;
bool needsRestartOnEachSegment() const;
void setCanDetectSwitches(bool);
void setRestartsOnEachSegment(bool);
protected:
bool b_startsfromzero;
bool b_reinitsonseek;
bool b_alwaysrestarts;
bool b_candetectswitches;
};
......
......@@ -89,6 +89,8 @@ AbstractDemuxer * HLSStream::createDemux(const StreamFormat &format)
case StreamFormat::WEBVTT:
ret = new Demuxer(p_realdemux, "webvttstream", fakeesout->getEsOut(), demuxersource);
if(ret)
ret->setRestartsOnEachSegment(true);
break;
default:
......
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