Commit dac320e3 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

demux: adaptive: fix CAN_SEEK and late fail

as child demuxers are not created yet when demux
wants seekable capability, CAN_SEEK was always false
parent 46653c82
......@@ -260,20 +260,6 @@ bool PlaylistManager::needsUpdate() const
return playlist->isLive() && (failedupdates < 3);
}
bool PlaylistManager::seekAble() const
{
if(playlist->isLive())
return false;
std::vector<AbstractStream *>::const_iterator it;
for(it=streams.begin(); it!=streams.end(); ++it)
{
if(!(*it)->seekAble())
return false;
}
return true;
}
void PlaylistManager::scheduleNextUpdate()
{
......@@ -393,7 +379,7 @@ int PlaylistManager::doControl(int i_query, va_list args)
switch (i_query)
{
case DEMUX_CAN_SEEK:
*(va_arg (args, bool *)) = seekAble();
*(va_arg (args, bool *)) = !playlist->isLive();
break;
case DEMUX_CAN_CONTROL_PACE:
......
......@@ -76,7 +76,6 @@ namespace adaptive
mtime_t getCurrentPlaybackTime() const;
int esCount() const;
bool seekAble() const;
void pruneLiveStream();
virtual bool reactivateStream(AbstractStream *);
bool setupPeriod();
......
......@@ -336,7 +336,7 @@ block_t * AbstractStream::readNextBlock()
bool AbstractStream::setPosition(mtime_t time, bool tryonly)
{
if(!demuxer)
if(!seekAble())
return false;
bool ret = segmentTracker->setPositionByTime(time, demuxer->reinitsOnSeek(), tryonly);
......
......@@ -65,7 +65,6 @@ namespace adaptive
mtime_t getMinAheadTime() const;
mtime_t getFirstDTS() const;
int esCount() const;
bool seekAble() const;
bool isSelected() const;
virtual bool reactivate(mtime_t);
bool isDisabled() const;
......@@ -86,6 +85,7 @@ namespace adaptive
virtual void trackerEvent(const SegmentTrackerEvent &); /* impl */
protected:
bool seekAble() const;
virtual block_t *checkBlock(block_t *, bool) = 0;
virtual AbstractDemuxer * createDemux(const StreamFormat &) = 0;
virtual bool startDemux();
......
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