[vlc-commits] demux: adaptative: don't call method in constructor

Francois Cartegnie git at videolan.org
Wed Oct 7 18:56:57 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Oct  6 19:43:40 2015 +0200| [dd1667187ecfe7b8796899bfd9524ee39cf0ae20] | committer: Francois Cartegnie

demux: adaptative: don't call method in constructor

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

 modules/demux/adaptative/plumbing/Demuxer.cpp |    3 ---
 modules/demux/dash/DASHStream.cpp             |    7 +++++++
 modules/demux/hls/HLSStreams.cpp              |    7 +++++++
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/modules/demux/adaptative/plumbing/Demuxer.cpp b/modules/demux/adaptative/plumbing/Demuxer.cpp
index 58ce858..38703ea 100644
--- a/modules/demux/adaptative/plumbing/Demuxer.cpp
+++ b/modules/demux/adaptative/plumbing/Demuxer.cpp
@@ -62,9 +62,6 @@ Demuxer::Demuxer(demux_t *p_realdemux_, const std::string &name_, es_out_t *out,
     {
         b_startsfromzero = true;
     }
-
-    if(!create())
-        throw VLC_EGENERIC;
 }
 
 Demuxer::~Demuxer()
diff --git a/modules/demux/dash/DASHStream.cpp b/modules/demux/dash/DASHStream.cpp
index 9c39797..10d7836 100644
--- a/modules/demux/dash/DASHStream.cpp
+++ b/modules/demux/dash/DASHStream.cpp
@@ -49,6 +49,13 @@ AbstractDemuxer * DASHStream::createDemux(const StreamFormat &format)
         case StreamFormat::UNSUPPORTED:
             break;
     }
+
+    if(ret && !ret->create())
+    {
+        delete ret;
+        ret = NULL;
+    }
+
     return ret;
 }
 
diff --git a/modules/demux/hls/HLSStreams.cpp b/modules/demux/hls/HLSStreams.cpp
index 977f60a..d8c34e4 100644
--- a/modules/demux/hls/HLSStreams.cpp
+++ b/modules/demux/hls/HLSStreams.cpp
@@ -67,6 +67,13 @@ AbstractDemuxer * HLSStream::createDemux(const StreamFormat &format)
         case StreamFormat::UNSUPPORTED:
             break;
     }
+
+    if(ret && !ret->create())
+    {
+        delete ret;
+        ret = NULL;
+    }
+
     return ret;
 }
 



More information about the vlc-commits mailing list