X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Fconsumer_null.c;h=d2abe19db8a1bcdf44e6aa79a0a86e51ee1ac448;hb=7651a182bf7191ab5db9b3741caeac2f86540281;hp=937e01333df82b512e270795635dfb9f9109cab0;hpb=f44c1d4653f43c8e7a63e6c3895f6f1f0ee0103b;p=melted diff --git a/src/modules/core/consumer_null.c b/src/modules/core/consumer_null.c index 937e013..d2abe19 100644 --- a/src/modules/core/consumer_null.c +++ b/src/modules/core/consumer_null.c @@ -67,14 +67,13 @@ mlt_consumer consumer_null_init( char *arg ) static int consumer_start( mlt_consumer this ) { // Get the properties - mlt_properties properties = mlt_consumer_properties( this ); + mlt_properties properties = MLT_CONSUMER_PROPERTIES( this ); // Check that we're not already running if ( !mlt_properties_get_int( properties, "running" ) ) { // Allocate a thread pthread_t *thread = calloc( 1, sizeof( pthread_t ) ); - pthread_attr_t thread_attributes; // Assign the thread to properties mlt_properties_set_data( properties, "thread", thread, sizeof( pthread_t ), free, NULL ); @@ -82,12 +81,8 @@ static int consumer_start( mlt_consumer this ) // Set the running state mlt_properties_set_int( properties, "running", 1 ); - // Inherit the scheduling priority - pthread_attr_init( &thread_attributes ); - pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED ); - // Create the thread - pthread_create( thread, &thread_attributes, consumer_thread, this ); + pthread_create( thread, NULL, consumer_thread, this ); } return 0; } @@ -98,7 +93,7 @@ static int consumer_start( mlt_consumer this ) static int consumer_stop( mlt_consumer this ) { // Get the properties - mlt_properties properties = mlt_consumer_properties( this ); + mlt_properties properties = MLT_CONSUMER_PROPERTIES( this ); // Check that we're running if ( mlt_properties_get_int( properties, "running" ) ) @@ -122,7 +117,7 @@ static int consumer_stop( mlt_consumer this ) static int consumer_is_stopped( mlt_consumer this ) { // Get the properties - mlt_properties properties = mlt_consumer_properties( this ); + mlt_properties properties = MLT_CONSUMER_PROPERTIES( this ); return !mlt_properties_get_int( properties, "running" ); } @@ -135,7 +130,7 @@ static void *consumer_thread( void *arg ) mlt_consumer this = arg; // Get the properties - mlt_properties properties = mlt_consumer_properties( this ); + mlt_properties properties = MLT_CONSUMER_PROPERTIES( this ); // Frame and size mlt_frame frame = NULL; @@ -150,6 +145,7 @@ static void *consumer_thread( void *arg ) if ( frame != NULL ) { // Close the frame + mlt_events_fire( properties, "consumer-frame-show", frame, NULL ); mlt_frame_close( frame ); } }