From: lilo_booter Date: Sat, 21 Aug 2004 09:46:24 +0000 (+0000) Subject: consumer purge X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=3bde0c8a0c130db6d3849a94f60d5b5ad234246e;p=melted consumer purge git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@381 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c index 1b67b74..a07f72d 100644 --- a/src/framework/mlt_consumer.c +++ b/src/framework/mlt_consumer.c @@ -422,6 +422,18 @@ static void consumer_read_ahead_stop( mlt_consumer this ) } } +void mlt_consumer_purge( mlt_consumer this ) +{ + if ( this->ahead ) + { + pthread_mutex_lock( &this->mutex ); + while ( mlt_deque_count( this->queue ) ) + mlt_frame_close( mlt_deque_pop_back( this->queue ) ); + pthread_cond_broadcast( &this->cond ); + pthread_mutex_unlock( &this->mutex ); + } +} + mlt_frame mlt_consumer_rt_frame( mlt_consumer this ) { // Frame to return diff --git a/src/framework/mlt_consumer.h b/src/framework/mlt_consumer.h index babb168..a3e05b5 100644 --- a/src/framework/mlt_consumer.h +++ b/src/framework/mlt_consumer.h @@ -60,6 +60,7 @@ extern mlt_service mlt_consumer_service( mlt_consumer self ); extern mlt_properties mlt_consumer_properties( mlt_consumer self ); extern int mlt_consumer_connect( mlt_consumer self, mlt_service producer ); extern int mlt_consumer_start( mlt_consumer self ); +extern void mlt_consumer_purge( mlt_consumer self ); extern mlt_frame mlt_consumer_get_frame( mlt_consumer self ); extern mlt_frame mlt_consumer_rt_frame( mlt_consumer self ); extern int mlt_consumer_stop( mlt_consumer self );