X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=mlt%2B%2B%2Fsrc%2FMltConsumer.cpp;fp=mlt%2B%2B%2Fsrc%2FMltConsumer.cpp;h=0a0a402b08c36abaae619d4d3207538dcf35c2eb;hb=4b4a655a5a304f49319b038d9a4eca494d6ce523;hp=657c816a67621327acd43a33fe5d49c2664291b5;hpb=b5453ebae648422ca342f9d8d7ca4d7ecc5c3ef7;p=melted diff --git a/mlt++/src/MltConsumer.cpp b/mlt++/src/MltConsumer.cpp index 657c816..0a0a402 100644 --- a/mlt++/src/MltConsumer.cpp +++ b/mlt++/src/MltConsumer.cpp @@ -21,12 +21,19 @@ #include #include #include "MltConsumer.h" +#include "MltEvent.h" using namespace Mlt; +Consumer::Consumer( ) : + instance( NULL ) +{ + instance = mlt_factory_consumer( NULL, NULL ); +} + Consumer::Consumer( char *id, char *arg ) : instance( NULL ) { - if ( arg != NULL ) + if ( id == NULL || arg != NULL ) { instance = mlt_factory_consumer( id, arg ); } @@ -109,3 +116,14 @@ bool Consumer::is_stopped( ) return mlt_consumer_is_stopped( get_consumer( ) ) != 0; } +int Consumer::run( ) +{ + int ret = start( ); + if ( !is_stopped( ) ) + { + Event *e = setup_wait_for( "consumer-stopped" ); + wait_for( e ); + delete e; + } + return ret; +}