X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=mlt%2B%2B%2Fsrc%2FMltFilter.cpp;h=90a178e175066ac6022870097e73d2b069f948d2;hb=1653a4a466e6289527be6de6cf42cac6907e1f89;hp=9fa043956a8b0ecdf5e34f42f6516b0068cfea7c;hpb=1a4cf7f5285d16d0530ea03c2b524be7c1aa5dbc;p=melted diff --git a/mlt++/src/MltFilter.cpp b/mlt++/src/MltFilter.cpp index 9fa0439..90a178e 100644 --- a/mlt++/src/MltFilter.cpp +++ b/mlt++/src/MltFilter.cpp @@ -24,7 +24,6 @@ using namespace Mlt; Filter::Filter( char *id, char *arg ) : - destroy( true ), instance( NULL ) { if ( arg != NULL ) @@ -48,22 +47,31 @@ Filter::Filter( char *id, char *arg ) : } } +Filter::Filter( Service &filter ) : + instance( NULL ) +{ + if ( filter.type( ) == filter_type ) + { + instance = ( mlt_filter )filter.get_service( ); + inc_ref( ); + } +} + Filter::Filter( Filter &filter ) : - destroy( false ), instance( filter.get_filter( ) ) { + inc_ref( ); } Filter::Filter( mlt_filter filter ) : - destroy( false ), instance( filter ) { + inc_ref( ); } Filter::~Filter( ) { - if ( destroy ) - mlt_filter_close( instance ); + mlt_filter_close( instance ); } mlt_filter Filter::get_filter( )