[vlmc-devel] Library: Fix not loading subclips

Yikai Lu git at videolan.org
Mon Aug 29 17:22:02 CEST 2016


vlmc | branch: medialibrary | Yikai Lu <luyikei.qmltu at gmail.com> | Sat Aug 27 19:39:25 2016 -0500| [d853b934abc14475c552e085e11ec3a749d8a997] | committer: Yikai Lu

Library: Fix not loading subclips

> https://code.videolan.org/videolan/vlmc/commit/d853b934abc14475c552e085e11ec3a749d8a997
---

 src/Library/Library.cpp | 6 +++++-
 src/Media/Media.h       | 4 +---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/Library/Library.cpp b/src/Library/Library.cpp
index e02efea..4489922 100644
--- a/src/Library/Library.cpp
+++ b/src/Library/Library.cpp
@@ -83,8 +83,12 @@ Library::postLoad()
 {
     for ( const auto& var : m_settings->value( "medias" )->get().toList() )
     {
-        auto m = Media::fromVariant( var );
+        auto map = var.toMap();
+        auto subClipsMap = map["clips"].toMap();
+        map["clips"] = QVariant();
+        auto m = Media::fromVariant( map );
         addMedia( m );
+        m->loadSubclip( subClipsMap );
     }
 }
 
diff --git a/src/Media/Media.h b/src/Media/Media.h
index 9f9193a..80b5ab9 100644
--- a/src/Media/Media.h
+++ b/src/Media/Media.h
@@ -103,12 +103,10 @@ public:
     const Backend::IInput*   input() const;
 
     static QSharedPointer<Media> fromVariant( const QVariant& v );
+    QSharedPointer<Clip>        loadSubclip( const QVariantMap& m );
 
     QString                    snapshot();
 
-private:
-    QSharedPointer<Clip>        loadSubclip( const QVariantMap& m );
-
 protected:
     std::unique_ptr<Backend::IInput>         m_input;
     medialibrary::MediaPtr      m_mlMedia;



More information about the Vlmc-devel mailing list