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

demux: adaptive: s/flush/drain

parent b64cd409
......@@ -187,7 +187,7 @@ bool AbstractStream::seekAble() const
return (demuxer &&
!fakeesout->restarting() &&
!discontinuity &&
!commandsqueue->isFlushing() );
!commandsqueue->isDraining() );
}
bool AbstractStream::isSelected() const
......@@ -311,7 +311,7 @@ AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline
return AbstractStream::buffering_end;
}
if(commandsqueue->isFlushing())
if(commandsqueue->isDraining())
{
vlc_mutex_unlock(&lock);
return AbstractStream::buffering_suspended;
......@@ -325,10 +325,10 @@ AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline
/* If demux fails because of probing failure / wrong format*/
if(discontinuity)
{
msg_Dbg( p_realdemux, "Flushing on format change" );
msg_Dbg( p_realdemux, "Draining on format change" );
prepareRestart();
discontinuity = false;
commandsqueue->setFlush();
commandsqueue->setDraining();
vlc_mutex_unlock(&lock);
return AbstractStream::buffering_ongoing;
}
......@@ -367,8 +367,8 @@ AbstractStream::buffering_status AbstractStream::doBufferize(mtime_t nz_deadline
prepareRestart(discontinuity);
if(discontinuity)
{
msg_Dbg(p_realdemux, "Flushing on discontinuity");
commandsqueue->setFlush();
msg_Dbg(p_realdemux, "Draining on discontinuity");
commandsqueue->setDraining();
discontinuity = false;
}
needrestart = false;
......@@ -399,7 +399,7 @@ AbstractStream::status AbstractStream::dequeue(mtime_t nz_deadline, mtime_t *pi_
*pi_pcr = nz_deadline;
if(commandsqueue->isFlushing())
if(commandsqueue->isDraining())
{
*pi_pcr = commandsqueue->Process(p_realdemux->out, VLC_TS_0 + nz_deadline);
if(!commandsqueue->isEmpty())
......
......@@ -228,7 +228,7 @@ CommandsQueue::CommandsQueue( CommandsFactory *f )
bufferinglevel = VLC_TS_INVALID;
pcr = VLC_TS_INVALID;
b_drop = false;
b_flushing = false;
b_draining = false;
b_eof = false;
commandsFactory = f;
vlc_mutex_init(&lock);
......@@ -300,8 +300,8 @@ mtime_t CommandsQueue::Process( es_out_t *out, mtime_t barrier )
}
pcr = lastdts;
if(commands.empty() && b_flushing)
b_flushing = false;
if(commands.empty() && b_draining)
b_draining = false;
vlc_mutex_unlock(&lock);
......@@ -336,7 +336,7 @@ void CommandsQueue::Abort( bool b_reset )
{
bufferinglevel = VLC_TS_INVALID;
pcr = VLC_TS_INVALID;
b_flushing = false;
b_draining = false;
b_eof = false;
}
vlc_mutex_unlock(&lock);
......@@ -357,18 +357,18 @@ void CommandsQueue::setDrop( bool b )
vlc_mutex_unlock(&lock);
}
void CommandsQueue::setFlush()
void CommandsQueue::setDraining()
{
vlc_mutex_lock(&lock);
LockedCommit();
b_flushing = !commands.empty();
b_draining = !commands.empty();
vlc_mutex_unlock(&lock);
}
bool CommandsQueue::isFlushing() const
bool CommandsQueue::isDraining() const
{
vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
bool b = b_flushing;
bool b = b_draining;
vlc_mutex_unlock(const_cast<vlc_mutex_t *>(&lock));
return b;
}
......@@ -378,7 +378,7 @@ void CommandsQueue::setEOF()
vlc_mutex_lock(&lock);
b_eof = true;
LockedCommit();
b_flushing = !commands.empty();
b_draining = !commands.empty();
vlc_mutex_unlock(&lock);
}
......
......@@ -159,9 +159,9 @@ namespace adaptive
void Commit();
bool isEmpty() const;
void setDrop( bool );
void setFlush();
void setDraining();
void setEOF();
bool isFlushing() const;
bool isDraining() const;
bool isEOF() const;
mtime_t getDemuxedAmount() const;
mtime_t getBufferingLevel() const;
......@@ -176,7 +176,7 @@ namespace adaptive
std::list<AbstractCommand *> commands;
mtime_t bufferinglevel;
mtime_t pcr;
bool b_flushing;
bool b_draining;
bool b_drop;
bool b_eof;
};
......
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