[vlmc-devel] commit: Library: Preventing a loading bug with very long clip list. ( Hugo Beauzee-Luyssen )

git at videolan.org git at videolan.org
Sat Mar 13 15:23:04 CET 2010


vlmc | branch: master | Hugo Beauzee-Luyssen <beauze.h at gmail.com> | Sat Mar 13 15:14:43 2010 +0100| [951decb7bc5890fc3647981fea8ede4054cb8e38] | committer: Hugo Beauzee-Luyssen 

Library: Preventing a loading bug with very long clip list.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=951decb7bc5890fc3647981fea8ede4054cb8e38
---

 src/Library/Library.cpp |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/Library/Library.cpp b/src/Library/Library.cpp
index 87acdfd..32180a1 100644
--- a/src/Library/Library.cpp
+++ b/src/Library/Library.cpp
@@ -46,7 +46,9 @@ Library::loadProject( const QDomElement& doc )
     if ( medias.isNull() == true )
         return ;
 
-    m_nbMediaToLoad = 0;
+    //Add a virtual media, which represents all the clip.
+    //This avoid emitting projectLoaded(); before all the clip are actually loaded.
+    m_nbMediaToLoad = 1;
     QDomElement media = medias.firstChild().toElement();
     while ( media.isNull() == false )
     {
@@ -65,6 +67,7 @@ Library::loadProject( const QDomElement& doc )
     if ( clips.isNull() == true )
         return ;
     load( clips, this );
+    mediaLoaded( NULL );
 }
 
 void
@@ -88,8 +91,11 @@ Library::saveProject( QXmlStreamWriter& project )
 void
 Library::mediaLoaded( const Media* media )
 {
-    disconnect( media, SIGNAL( metaDataComputed( const Media* ) ),
-             this, SLOT( mediaLoaded( const Media* ) ) );
+    if ( media != NULL )
+    {
+        disconnect( media, SIGNAL( metaDataComputed( const Media* ) ),
+                 this, SLOT( mediaLoaded( const Media* ) ) );
+    }
     m_nbMediaToLoad.fetchAndAddAcquire( -1 );
     if ( m_nbMediaToLoad == 0 )
         emit projectLoaded();



More information about the Vlmc-devel mailing list