[vlc-devel] [PATCH 3/6] dash: dashmanager refactoring

Christopher Mueller "Christopher Mueller" at mailsrv.uni-klu.ac.at
Tue Apr 3 16:41:40 CEST 2012


From: Christopher Mueller <christopher.mueller at itec.aau.at>

Signed-off-by: Christopher Mueller <christopher.mueller at itec.aau.at>
---
 modules/stream_filter/dash/DASHManager.cpp |   31 +++++++++++++++------------
 modules/stream_filter/dash/dash.cpp        |    5 +---
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/modules/stream_filter/dash/DASHManager.cpp b/modules/stream_filter/dash/DASHManager.cpp
index b897019..d89b9a2 100644
--- a/modules/stream_filter/dash/DASHManager.cpp
+++ b/modules/stream_filter/dash/DASHManager.cpp
@@ -43,20 +43,6 @@ DASHManager::DASHManager    ( MPD *mpd,
              mpd            ( mpd ),
              stream         (stream)
 {
-    this->mpdManager        = mpd::MPDManagerFactory::create( mpd );
-    if ( this->mpdManager == NULL )
-        return ;
-    this->adaptationLogic   = AdaptationLogicFactory::create( this->logicType, this->mpdManager, this->stream);
-    if ( this->adaptationLogic == NULL )
-        return ;
-
-    this->conManager = new dash::http::HTTPConnectionManager(this->adaptationLogic, this->stream);
-
-    this->buffer     = new BlockBuffer(this->stream);
-    this->downloader = new DASHDownloader(this->conManager, this->buffer);
-
-    this->conManager->attach(this->adaptationLogic);
-    this->buffer->attach(this->adaptationLogic);
 }
 DASHManager::~DASHManager   ()
 {
@@ -69,6 +55,23 @@ DASHManager::~DASHManager   ()
 
 bool    DASHManager::start()
 {
+    this->mpdManager = mpd::MPDManagerFactory::create( mpd );
+
+    if ( this->mpdManager == NULL )
+        return false;
+
+    this->adaptationLogic = AdaptationLogicFactory::create( this->logicType, this->mpdManager, this->stream);
+
+    if ( this->adaptationLogic == NULL )
+        return false;
+
+    this->conManager = new dash::http::HTTPConnectionManager(this->adaptationLogic, this->stream);
+    this->buffer     = new BlockBuffer(this->stream);
+    this->downloader = new DASHDownloader(this->conManager, this->buffer);
+
+    this->conManager->attach(this->adaptationLogic);
+    this->buffer->attach(this->adaptationLogic);
+
     return this->downloader->start();
 }
 int     DASHManager::read( void *p_buffer, size_t len )
diff --git a/modules/stream_filter/dash/dash.cpp b/modules/stream_filter/dash/dash.cpp
index 56eaa9f..423a2f6 100644
--- a/modules/stream_filter/dash/dash.cpp
+++ b/modules/stream_filter/dash/dash.cpp
@@ -117,10 +117,7 @@ static int Open(vlc_object_t *p_obj)
                                           dash::logic::IAdaptationLogic::RateBased,
                                           p_stream);
 
-    if ( p_dashManager->getMpdManager()           == NULL   ||
-         p_dashManager->getMpdManager()->getMPD() == NULL   ||
-         p_dashManager->getAdaptionLogic()        == NULL   ||
-         p_dashManager->start()                   == false)
+    if(!p_dashManager->start())
     {
         delete p_dashManager;
         free( p_sys );
-- 
1.7.0.4




More information about the vlc-devel mailing list