Commit 858b4b60 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptive: explicitely call drain from eof

parent f3068ce6
...@@ -360,8 +360,7 @@ void CommandsQueue::setDrop( bool b ) ...@@ -360,8 +360,7 @@ void CommandsQueue::setDrop( bool b )
void CommandsQueue::setDraining() void CommandsQueue::setDraining()
{ {
vlc_mutex_lock(&lock); vlc_mutex_lock(&lock);
LockedCommit(); LockedSetDraining();
b_draining = !commands.empty();
vlc_mutex_unlock(&lock); vlc_mutex_unlock(&lock);
} }
...@@ -377,8 +376,7 @@ void CommandsQueue::setEOF() ...@@ -377,8 +376,7 @@ void CommandsQueue::setEOF()
{ {
vlc_mutex_lock(&lock); vlc_mutex_lock(&lock);
b_eof = true; b_eof = true;
LockedCommit(); LockedSetDraining();
b_draining = !commands.empty();
vlc_mutex_unlock(&lock); vlc_mutex_unlock(&lock);
} }
...@@ -423,6 +421,12 @@ mtime_t CommandsQueue::getFirstDTS() const ...@@ -423,6 +421,12 @@ mtime_t CommandsQueue::getFirstDTS() const
return i_firstdts; return i_firstdts;
} }
void CommandsQueue::LockedSetDraining()
{
LockedCommit();
b_draining = !commands.empty();
}
mtime_t CommandsQueue::getPCR() const mtime_t CommandsQueue::getPCR() const
{ {
vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock)); vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
......
...@@ -172,6 +172,7 @@ namespace adaptive ...@@ -172,6 +172,7 @@ namespace adaptive
CommandsFactory *commandsFactory; CommandsFactory *commandsFactory;
vlc_mutex_t lock; vlc_mutex_t lock;
void LockedCommit(); void LockedCommit();
void LockedSetDraining();
std::list<AbstractCommand *> incoming; std::list<AbstractCommand *> incoming;
std::list<AbstractCommand *> commands; std::list<AbstractCommand *> commands;
mtime_t bufferinglevel; mtime_t bufferinglevel;
......
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