[vlc-commits] demux: adaptive: explicitely call drain from eof

Francois Cartegnie git at videolan.org
Thu Jul 13 15:20:55 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jul 12 17:54:10 2017 +0200| [858b4b60598c25ac9701612cc1bc48f36364197d] | committer: Francois Cartegnie

demux: adaptive: explicitely call drain from eof

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=858b4b60598c25ac9701612cc1bc48f36364197d
---

 modules/demux/adaptive/plumbing/CommandsQueue.cpp | 12 ++++++++----
 modules/demux/adaptive/plumbing/CommandsQueue.hpp |  1 +
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.cpp b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
index 219d0052c5..6a262a67c6 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.cpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
@@ -360,8 +360,7 @@ void CommandsQueue::setDrop( bool b )
 void CommandsQueue::setDraining()
 {
     vlc_mutex_lock(&lock);
-    LockedCommit();
-    b_draining = !commands.empty();
+    LockedSetDraining();
     vlc_mutex_unlock(&lock);
 }
 
@@ -377,8 +376,7 @@ void CommandsQueue::setEOF()
 {
     vlc_mutex_lock(&lock);
     b_eof = true;
-    LockedCommit();
-    b_draining = !commands.empty();
+    LockedSetDraining();
     vlc_mutex_unlock(&lock);
 }
 
@@ -423,6 +421,12 @@ mtime_t CommandsQueue::getFirstDTS() const
     return i_firstdts;
 }
 
+void CommandsQueue::LockedSetDraining()
+{
+    LockedCommit();
+    b_draining = !commands.empty();
+}
+
 mtime_t CommandsQueue::getPCR() const
 {
     vlc_mutex_lock(const_cast<vlc_mutex_t *>(&lock));
diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.hpp b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
index a1a68a344d..979820e66a 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.hpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
@@ -172,6 +172,7 @@ namespace adaptive
             CommandsFactory *commandsFactory;
             vlc_mutex_t lock;
             void LockedCommit();
+            void LockedSetDraining();
             std::list<AbstractCommand *> incoming;
             std::list<AbstractCommand *> commands;
             mtime_t bufferinglevel;



More information about the vlc-commits mailing list