[vlc-commits] demux: adaptive: add eof flag to commands queue

Francois Cartegnie git at videolan.org
Sat Jul 9 18:42:44 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jun 30 17:35:45 2016 +0200| [5b5ac44e603e6e5de0ce6a9030c4e969c0a319a3] | committer: Francois Cartegnie

demux: adaptive: add eof flag to commands queue

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

 modules/demux/adaptive/plumbing/CommandsQueue.cpp |   19 +++++++++++++++++++
 modules/demux/adaptive/plumbing/CommandsQueue.hpp |    3 +++
 2 files changed, 22 insertions(+)

diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.cpp b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
index 79cf540..8b74e6c 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.cpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
@@ -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();
diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.hpp b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
index 42d55ef..d459978 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.hpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
@@ -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;
     };
 }
 



More information about the vlc-commits mailing list