[vlmc-devel] Metadata: Fix image import.

Hugo Beauzée-Luyssen git at videolan.org
Sun Sep 23 16:31:36 CEST 2012


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Sep 23 16:30:22 2012 +0300| [6cb44e603bffe4f585cefe809df3e9ed022753c9] | committer: Hugo Beauzée-Luyssen

Metadata: Fix image import.

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

 src/Gui/media/GuiMedia.cpp      |    1 -
 src/Media/Media.cpp             |    5 +----
 src/Metadata/MetaDataWorker.cpp |   13 ++++++-------
 3 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/Gui/media/GuiMedia.cpp b/src/Gui/media/GuiMedia.cpp
index 26ab7e3..3a9221c 100644
--- a/src/Gui/media/GuiMedia.cpp
+++ b/src/Gui/media/GuiMedia.cpp
@@ -43,7 +43,6 @@ void GUIMedia::snapshotReady(const char *fileName)
         emit snapshotComputed( qobject_cast<const Media*>( this ) );
     }
     tmp.remove();
-
 }
 
 GUIMedia::~GUIMedia()
diff --git a/src/Media/Media.cpp b/src/Media/Media.cpp
index ef31fd0..624f7b8 100644
--- a/src/Media/Media.cpp
+++ b/src/Media/Media.cpp
@@ -300,10 +300,7 @@ Media::setFilePath( const QString &filePath )
     m_fileInfo = new QFileInfo( filePath );
     m_fileName = m_fileInfo->fileName();
     computeFileType();
-    if ( m_fileType != Media::Image )
-        m_mrl = "file:///" + QUrl::toPercentEncoding( filePath, "/" );
-    else
-        m_mrl = "fake:///" + filePath; //It seems the url encoding part is handled internally by VLC.
+    m_mrl = "file:///" + QUrl::toPercentEncoding( filePath, "/" );
     if ( m_vlcMedia )
         delete m_vlcMedia;
     m_vlcMedia = new LibVLCpp::Media( m_mrl );
diff --git a/src/Metadata/MetaDataWorker.cpp b/src/Metadata/MetaDataWorker.cpp
index 233603d..4ef4da3 100644
--- a/src/Metadata/MetaDataWorker.cpp
+++ b/src/Metadata/MetaDataWorker.cpp
@@ -100,6 +100,11 @@ MetaDataWorker::metaDataAvailable()
         if ( m_media->hasVideoTrack() == false )
             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 )
     {
         // In theory the vout is created before the position actually changes.
@@ -132,17 +137,11 @@ MetaDataWorker::metaDataAvailable()
     m_media->emitMetaDataComputed();
 #ifdef WITH_GUI
     //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();
         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
     finalize();
 }



More information about the Vlmc-devel mailing list