consumer purge
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 21 Aug 2004 09:46:24 +0000 (09:46 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Sat, 21 Aug 2004 09:46:24 +0000 (09:46 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@381 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_consumer.c
src/framework/mlt_consumer.h

index 1b67b74..a07f72d 100644 (file)
@@ -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
index babb168..a3e05b5 100644 (file)
@@ -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 );