[vlmc-devel] [PATCH] Fix setting wrong length to GraphicsEffectItem

Yikai Lu luyikei.qmltu at gmail.com
Mon Jun 27 16:40:39 CEST 2016


Mlt::Filter returns 0 if it has unlimited length. I follow this rule because filters can be applied to Output, which doesn't have length.
---
 src/Backend/IFilter.h           | 1 +
 src/Gui/timeline/TracksView.cpp | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/Backend/IFilter.h b/src/Backend/IFilter.h
index 7284f12..5c694b1 100644
--- a/src/Backend/IFilter.h
+++ b/src/Backend/IFilter.h
@@ -66,6 +66,7 @@ namespace Backend
         virtual void            setBoundaries( int64_t begin, int64_t end ) = 0;
         virtual int64_t         begin() const = 0;
         virtual int64_t         end() const = 0;
+        // Returns zero if unlimited
         virtual int64_t         length() const = 0;
 
         virtual const IFilterInfo&  filterInfo() const = 0;
diff --git a/src/Gui/timeline/TracksView.cpp b/src/Gui/timeline/TracksView.cpp
index 0f282ee..6cd8712 100644
--- a/src/Gui/timeline/TracksView.cpp
+++ b/src/Gui/timeline/TracksView.cpp
@@ -311,6 +311,8 @@ TracksView::addEffectItem( std::shared_ptr<EffectHelper> const& effectHelper, Wo
         if ( mediaItem != nullptr )
         {
             item->setContainer( mediaItem );
+            if ( item->width() == 0 )
+                item->setWidth( mediaItem->width() );
             break ;
         }
     }
-- 
1.9.1



More information about the Vlmc-devel mailing list