Commit f65b96e9 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MetadataWorker: Don't compute snapshot a second time.

parent 57490d27
......@@ -54,6 +54,12 @@ GUIMedia::snapshot() const
return *GUIMedia::defaultSnapshot;
}
bool
GUIMedia::hasSnapshot() const
{
return ( m_snapshot != NULL );
}
void
GUIMedia::emitSnapshotComputed()
{
......
......@@ -37,6 +37,7 @@ public:
~GUIMedia();
void setSnapshot( QPixmap* snapshot );
const QPixmap &snapshot() const;
bool hasSnapshot() const;
void emitSnapshotComputed();
protected:
......
......@@ -145,8 +145,8 @@ MetaDataWorker::metaDataAvailable()
m_media->emitMetaDataComputed();
#ifdef WITH_GUI
//Setting time for snapshot :
if ( m_media->fileType() == Media::Video ||
m_media->fileType() == Media::Image )
if ( ( m_media->fileType() == Media::Video ||
m_media->fileType() == Media::Image ) && m_media->hasSnapshot() == false )
{
connect( m_mediaPlayer, SIGNAL( positionChanged( float ) ), this, SLOT( renderSnapshot() ) );
m_mediaPlayer->setTime( m_mediaPlayer->getLength() / 3 );
......
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