Commit 28fa777a authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

MetadataWorker: Detect some other failure cases.

If the end is reached before we stopped the media, there's something
wrong !
parent 383cd5e1
...@@ -65,6 +65,7 @@ MetaDataWorker::compute() ...@@ -65,6 +65,7 @@ MetaDataWorker::compute()
connect( m_mediaPlayer, SIGNAL( playing() ), connect( m_mediaPlayer, SIGNAL( playing() ),
this, SLOT( entrypointPlaying() ), Qt::QueuedConnection ); this, SLOT( entrypointPlaying() ), Qt::QueuedConnection );
connect( m_mediaPlayer, SIGNAL( errorEncountered() ), this, SLOT( failure() ) ); connect( m_mediaPlayer, SIGNAL( errorEncountered() ), this, SLOT( failure() ) );
connect( m_mediaPlayer, SIGNAL( endReached() ), this, SLOT( failure() ) );
m_mediaPlayer->play(); m_mediaPlayer->play();
m_media->flushVolatileParameters(); m_media->flushVolatileParameters();
} }
...@@ -96,11 +97,9 @@ MetaDataWorker::metaDataAvailable() ...@@ -96,11 +97,9 @@ MetaDataWorker::metaDataAvailable()
m_mediaIsPlaying = false; m_mediaIsPlaying = false;
m_lengthHasChanged = 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 ) if ( m_media->fileType() != Media::Audio )
{ {
//In order to wait for the VOUT to be ready:
m_timer.restart(); m_timer.restart();
while ( m_mediaPlayer->hasVout() == false && while ( m_mediaPlayer->hasVout() == false &&
m_timer.elapsed() < 3000 ) m_timer.elapsed() < 3000 )
...@@ -196,6 +195,7 @@ void ...@@ -196,6 +195,7 @@ void
MetaDataWorker::finalize() MetaDataWorker::finalize()
{ {
m_media->disconnect( this ); m_media->disconnect( this );
m_mediaPlayer->disconnect( this );
emit computed(); emit computed();
delete this; delete this;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment