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 ...@@ -260,20 +260,6 @@ bool PlaylistManager::needsUpdate() const
return playlist->isLive() && (failedupdates < 3); 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() void PlaylistManager::scheduleNextUpdate()
{ {
...@@ -393,7 +379,7 @@ int PlaylistManager::doControl(int i_query, va_list args) ...@@ -393,7 +379,7 @@ int PlaylistManager::doControl(int i_query, va_list args)
switch (i_query) switch (i_query)
{ {
case DEMUX_CAN_SEEK: case DEMUX_CAN_SEEK:
*(va_arg (args, bool *)) = seekAble(); *(va_arg (args, bool *)) = !playlist->isLive();
break; break;
case DEMUX_CAN_CONTROL_PACE: case DEMUX_CAN_CONTROL_PACE:
......
...@@ -76,7 +76,6 @@ namespace adaptive ...@@ -76,7 +76,6 @@ namespace adaptive
mtime_t getCurrentPlaybackTime() const; mtime_t getCurrentPlaybackTime() const;
int esCount() const; int esCount() const;
bool seekAble() const;
void pruneLiveStream(); void pruneLiveStream();
virtual bool reactivateStream(AbstractStream *); virtual bool reactivateStream(AbstractStream *);
bool setupPeriod(); bool setupPeriod();
......
...@@ -336,7 +336,7 @@ block_t * AbstractStream::readNextBlock() ...@@ -336,7 +336,7 @@ block_t * AbstractStream::readNextBlock()
bool AbstractStream::setPosition(mtime_t time, bool tryonly) bool AbstractStream::setPosition(mtime_t time, bool tryonly)
{ {
if(!demuxer) if(!seekAble())
return false; return false;
bool ret = segmentTracker->setPositionByTime(time, demuxer->reinitsOnSeek(), tryonly); bool ret = segmentTracker->setPositionByTime(time, demuxer->reinitsOnSeek(), tryonly);
......
...@@ -65,7 +65,6 @@ namespace adaptive ...@@ -65,7 +65,6 @@ namespace adaptive
mtime_t getMinAheadTime() const; mtime_t getMinAheadTime() const;
mtime_t getFirstDTS() const; mtime_t getFirstDTS() const;
int esCount() const; int esCount() const;
bool seekAble() const;
bool isSelected() const; bool isSelected() const;
virtual bool reactivate(mtime_t); virtual bool reactivate(mtime_t);
bool isDisabled() const; bool isDisabled() const;
...@@ -86,6 +85,7 @@ namespace adaptive ...@@ -86,6 +85,7 @@ namespace adaptive
virtual void trackerEvent(const SegmentTrackerEvent &); /* impl */ virtual void trackerEvent(const SegmentTrackerEvent &); /* impl */
protected: protected:
bool seekAble() const;
virtual block_t *checkBlock(block_t *, bool) = 0; virtual block_t *checkBlock(block_t *, bool) = 0;
virtual AbstractDemuxer * createDemux(const StreamFormat &) = 0; virtual AbstractDemuxer * createDemux(const StreamFormat &) = 0;
virtual bool startDemux(); 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