[vlmc-devel] commit: MetadataWorker: Detect some other failure cases. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Mon May 31 23:55:10 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Mon May 31 23:57:46 2010 +0200| [28fa777ad60cef1a013aa8bdcf28dc5e25f6e519] | committer: Hugo Beauzée-Luyssen 

MetadataWorker: Detect some other failure cases.

If the end is reached before we stopped the media, there's something
wrong !

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

 src/Metadata/MetaDataWorker.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/Metadata/MetaDataWorker.cpp b/src/Metadata/MetaDataWorker.cpp
index 731e01c..0590743 100644
--- a/src/Metadata/MetaDataWorker.cpp
+++ b/src/Metadata/MetaDataWorker.cpp
@@ -65,6 +65,7 @@ MetaDataWorker::compute()
     connect( m_mediaPlayer, SIGNAL( playing() ),
              this, SLOT( entrypointPlaying() ), Qt::QueuedConnection );
     connect( m_mediaPlayer, SIGNAL( errorEncountered() ), this, SLOT( failure() ) );
+    connect( m_mediaPlayer, SIGNAL( endReached() ), this, SLOT( failure() ) );
     m_mediaPlayer->play();
     m_media->flushVolatileParameters();
 }
@@ -96,11 +97,9 @@ MetaDataWorker::metaDataAvailable()
     m_mediaIsPlaying = false;
     m_lengthHasChanged = false;
 
-    //In order to wait for the VOUT to be ready:
-    //Until we have a way of knowing when it is, both getWidth and getHeight method
-    //will trigger exception... so we shut it up.
     if ( m_media->fileType() != Media::Audio )
     {
+        //In order to wait for the VOUT to be ready:
         m_timer.restart();
         while ( m_mediaPlayer->hasVout() == false &&
                 m_timer.elapsed() < 3000 )
@@ -196,6 +195,7 @@ void
 MetaDataWorker::finalize()
 {
     m_media->disconnect( this );
+    m_mediaPlayer->disconnect( this );
     emit    computed();
     delete this;
 }



More information about the Vlmc-devel mailing list