X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fsdl%2Fconsumer_sdl_still.c;h=13f73ee52a0c29084ea11ba551a04f865f098b6e;hb=2da2cbad1bf870a02d095c21f8c157a92a9be84b;hp=998d3e09fc9a94fd5dd0f8a3a6e7f5544baa2832;hpb=2e467c2eeba2b51aecddda21d4bb97bef4cd1459;p=melted diff --git a/src/modules/sdl/consumer_sdl_still.c b/src/modules/sdl/consumer_sdl_still.c index 998d3e0..13f73ee 100644 --- a/src/modules/sdl/consumer_sdl_still.c +++ b/src/modules/sdl/consumer_sdl_still.c @@ -57,6 +57,7 @@ struct consumer_sdl_s uint8_t *buffer; int last_position; mlt_producer last_producer; + int filtered; }; /** Forward references to static functions. @@ -85,12 +86,6 @@ mlt_consumer consumer_sdl_still_init( char *arg ) // Get the parent consumer object mlt_consumer parent = &this->parent; - // Attach a colour space converter - mlt_filter filter = mlt_factory_filter( "avcolour_space", NULL ); - mlt_properties_set_int( mlt_filter_properties( filter ), "forced", mlt_image_yuv422 ); - mlt_service_attach( mlt_consumer_service( &this->parent ), filter ); - mlt_filter_close( filter ); - // We have stuff to clean up, so override the close method parent->close = consumer_close; @@ -162,7 +157,17 @@ static int consumer_start( mlt_consumer parent ) if ( !this->running ) { pthread_attr_t thread_attributes; - + + // Attach a colour space converter + if ( !this->filtered ) + { + mlt_filter filter = mlt_factory_filter( "avcolour_space", NULL ); + mlt_properties_set_int( mlt_filter_properties( filter ), "forced", mlt_image_yuv422 ); + mlt_service_attach( mlt_consumer_service( &this->parent ), filter ); + mlt_filter_close( filter ); + this->filtered = 1; + } + consumer_stop( parent ); this->last_position = -1;