[vlmc-devel] MainWorkflow::ClipInfo : Search SequenceWorkfloer first

Yikai Lu git at videolan.org
Tue Aug 23 18:09:31 CEST 2016


vlmc | branch: medialibrary | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Aug 21 18:33:08 2016 -0500| [9c1d82d469df37edac7c0012c0a5307da2b73e79] | committer: Hugo Beauzée-Luyssen

MainWorkflow::ClipInfo : Search SequenceWorkfloer first

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> https://code.videolan.org/videolan/vlmc/commit/9c1d82d469df37edac7c0012c0a5307da2b73e79
---

 src/Workflow/MainWorkflow.cpp | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/Workflow/MainWorkflow.cpp b/src/Workflow/MainWorkflow.cpp
index e7a15e8..8ea4bf1 100644
--- a/src/Workflow/MainWorkflow.cpp
+++ b/src/Workflow/MainWorkflow.cpp
@@ -214,6 +214,19 @@ MainWorkflow::addClip( const QString& uuid, quint32 trackId, qint32 pos, bool is
 QJsonObject
 MainWorkflow::clipInfo( const QString& uuid )
 {
+    auto clip = m_sequenceWorkflow->clip( uuid );
+    if ( clip != nullptr )
+    {
+        auto h = clip->toVariant().toHash();
+        h["length"] = (qint64)( clip->input()->length() );
+        h["name"] = clip->media()->title();
+        h["audio"] = clip->formats().testFlag( Clip::Audio );
+        h["video"] = clip->formats().testFlag( Clip::Video );
+        h["position"] = m_sequenceWorkflow->position( uuid );
+        h["trackId"] = m_sequenceWorkflow->trackId( uuid );
+        return QJsonObject::fromVariantHash( h );
+    }
+
     auto lClip = Core::instance()->library()->clip( uuid );
     if ( lClip != nullptr )
     {
@@ -227,18 +240,7 @@ MainWorkflow::clipInfo( const QString& uuid )
         return QJsonObject::fromVariantHash( h );
     }
 
-    auto clip = m_sequenceWorkflow->clip( uuid );
-    if ( !clip )
-        return QJsonObject();
-
-    auto h = clip->toVariant().toHash();
-    h["length"] = (qint64)( clip->input()->length() );
-    h["name"] = clip->media()->title();
-    h["audio"] = clip->formats().testFlag( Clip::Audio );
-    h["video"] = clip->formats().testFlag( Clip::Video );
-    h["position"] = m_sequenceWorkflow->position( uuid );
-    h["trackId"] = m_sequenceWorkflow->trackId( uuid );
-    return QJsonObject::fromVariantHash( h );
+    return QJsonObject();
 }
 
 void



More information about the Vlmc-devel mailing list