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

Metadata: Fix image import.

parent 79b5886d
...@@ -43,7 +43,6 @@ void GUIMedia::snapshotReady(const char *fileName) ...@@ -43,7 +43,6 @@ void GUIMedia::snapshotReady(const char *fileName)
emit snapshotComputed( qobject_cast<const Media*>( this ) ); emit snapshotComputed( qobject_cast<const Media*>( this ) );
} }
tmp.remove(); tmp.remove();
} }
GUIMedia::~GUIMedia() GUIMedia::~GUIMedia()
......
...@@ -300,10 +300,7 @@ Media::setFilePath( const QString &filePath ) ...@@ -300,10 +300,7 @@ Media::setFilePath( const QString &filePath )
m_fileInfo = new QFileInfo( filePath ); m_fileInfo = new QFileInfo( filePath );
m_fileName = m_fileInfo->fileName(); m_fileName = m_fileInfo->fileName();
computeFileType(); computeFileType();
if ( m_fileType != Media::Image ) m_mrl = "file:///" + QUrl::toPercentEncoding( filePath, "/" );
m_mrl = "file:///" + QUrl::toPercentEncoding( filePath, "/" );
else
m_mrl = "fake:///" + filePath; //It seems the url encoding part is handled internally by VLC.
if ( m_vlcMedia ) if ( m_vlcMedia )
delete m_vlcMedia; delete m_vlcMedia;
m_vlcMedia = new LibVLCpp::Media( m_mrl ); m_vlcMedia = new LibVLCpp::Media( m_mrl );
......
...@@ -100,6 +100,11 @@ MetaDataWorker::metaDataAvailable() ...@@ -100,6 +100,11 @@ MetaDataWorker::metaDataAvailable()
if ( m_media->hasVideoTrack() == false ) if ( m_media->hasVideoTrack() == false )
m_media->setFileType( Media::Audio ); m_media->setFileType( Media::Audio );
} }
else if ( m_media->fileType() == Media::Audio )
{
if ( m_media->hasVideoTrack() == true )
m_media->setFileType( Media::Video );
}
if ( m_media->fileType() != Media::Audio ) if ( m_media->fileType() != Media::Audio )
{ {
// In theory the vout is created before the position actually changes. // In theory the vout is created before the position actually changes.
...@@ -132,17 +137,11 @@ MetaDataWorker::metaDataAvailable() ...@@ -132,17 +137,11 @@ MetaDataWorker::metaDataAvailable()
m_media->emitMetaDataComputed(); m_media->emitMetaDataComputed();
#ifdef WITH_GUI #ifdef WITH_GUI
//Setting time for snapshot : //Setting time for snapshot :
if ( m_media->fileType() == Media::Video && m_media->hasSnapshot() == false ) if ( m_media->fileType() != Media::Audio && m_media->hasSnapshot() == false )
{ {
computeSnapshot(); computeSnapshot();
return ; return ;
} }
else if ( m_media->fileType() == Media::Image && m_media->hasSnapshot() == false )
{
// QPixmap *pixmap = new QPixmap( m_media->fileInfo()->absoluteFilePath() );
// m_media->setSnapshot( pixmap );
// m_media->emitSnapshotComputed();
}
#endif #endif
finalize(); finalize();
} }
......
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