Commit 5b5ac44e authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptive: add eof flag to commands queue

parent 3ed98457
......@@ -199,6 +199,7 @@ CommandsQueue::CommandsQueue( CommandsFactory *f )
pcr = VLC_TS_INVALID;
b_drop = false;
b_flushing = false;
b_eof = false;
commandsFactory = f;
vlc_mutex_init(&lock);
}
......@@ -306,6 +307,7 @@ void CommandsQueue::Abort( bool b_reset )
bufferinglevel = VLC_TS_INVALID;
pcr = VLC_TS_INVALID;
b_flushing = false;
b_eof = false;
}
vlc_mutex_unlock(&lock);
}
......@@ -341,6 +343,23 @@ bool CommandsQueue::isFlushing() const
return b;
}
void CommandsQueue::setEOF()
{
vlc_mutex_lock(&lock);
b_eof = true;
LockedCommit();
b_flushing = !commands.empty();
vlc_mutex_unlock(&lock);
}
bool CommandsQueue::isEOF() const
{
vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
bool b = b_eof;
vlc_mutex_unlock(const_cast<vlc_mutex_t *>(&lock));
return b;
}
mtime_t CommandsQueue::getDemuxedAmount() const
{
return bufferinglevel - getFirstDTS();
......
......@@ -146,7 +146,9 @@ namespace adaptive
bool isEmpty() const;
void setDrop( bool );
void setFlush();
void setEOF();
bool isFlushing() const;
bool isEOF() const;
mtime_t getDemuxedAmount() const;
mtime_t getBufferingLevel() const;
mtime_t getFirstDTS() const;
......@@ -162,6 +164,7 @@ namespace adaptive
mtime_t pcr;
bool b_flushing;
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