[vlc-commits] demux: adaptive: remove demux restart method

Francois Cartegnie git at videolan.org
Fri Sep 30 19:41:58 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Sep 30 16:25:06 2016 +0200| [f96eda2546b06ff0f0b990d4cb331bacb6c2ef7d] | committer: Francois Cartegnie

demux: adaptive: remove demux restart method

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

 modules/demux/adaptive/Streams.cpp          | 7 +++++--
 modules/demux/adaptive/plumbing/Demuxer.cpp | 5 +----
 modules/demux/adaptive/plumbing/Demuxer.hpp | 5 ++---
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index 01f97d4..2fe6462 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -229,8 +229,11 @@ bool AbstractStream::restartDemux()
     {
         /* Push all ES as recycling candidates */
         fakeesout->recycleAll();
-        /* Restart with ignoring pushes to queue */
-        return demuxer->restart(commandsqueue);
+        /* Restart with ignoring es_Del pushes to queue when terminating demux */
+        commandsqueue->setDrop(true);
+        demuxer->destroy();
+        commandsqueue->setDrop(false);
+        return demuxer->create();
     }
     commandsqueue->Commit();
     return true;
diff --git a/modules/demux/adaptive/plumbing/Demuxer.cpp b/modules/demux/adaptive/plumbing/Demuxer.cpp
index d09c110..f44ec19 100644
--- a/modules/demux/adaptive/plumbing/Demuxer.cpp
+++ b/modules/demux/adaptive/plumbing/Demuxer.cpp
@@ -103,17 +103,14 @@ bool Demuxer::create()
     return true;
 }
 
-bool Demuxer::restart(CommandsQueue *queue)
+void Demuxer::destroy()
 {
     if(p_demux)
     {
-        queue->setDrop(true);
         demux_Delete(p_demux);
         p_demux = NULL;
-        queue->setDrop(false);
     }
     sourcestream->Reset();
-    return create();
 }
 
 void Demuxer::drain()
diff --git a/modules/demux/adaptive/plumbing/Demuxer.hpp b/modules/demux/adaptive/plumbing/Demuxer.hpp
index a239a35..6b62a27 100644
--- a/modules/demux/adaptive/plumbing/Demuxer.hpp
+++ b/modules/demux/adaptive/plumbing/Demuxer.hpp
@@ -25,7 +25,6 @@
 
 namespace adaptive
 {
-    class CommandsQueue;
     class AbstractSourceStream;
 
     class AbstractDemuxer
@@ -36,7 +35,7 @@ namespace adaptive
             virtual int demux(mtime_t) = 0;
             virtual void drain() = 0;
             virtual bool create() = 0;
-            virtual bool restart(CommandsQueue *) = 0;
+            virtual void destroy() = 0;
             bool alwaysStartsFromZero() const;
             bool needsRestartOnSeek() const;
             bool needsRestartOnSwitch() const;
@@ -56,7 +55,7 @@ namespace adaptive
             virtual int demux(mtime_t); /* impl */
             virtual void drain(); /* impl */
             virtual bool create(); /* impl */
-            virtual bool restart(CommandsQueue *); /* impl */
+            virtual void destroy(); /* impl */
 
         protected:
             AbstractSourceStream *sourcestream;



More information about the vlc-commits mailing list