X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_consumer.c;h=bcc65ac13d81b54cd823166cae075b0f55270767;hb=087a35e2a051b00b8cb007e57c9657794cea123a;hp=32c76680561a44741ed4b0d03e4493f6f712b560;hpb=0a763f7b10f28184bba59fd8cecbc29999c131ef;p=melted diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c index 32c7668..bcc65ac 100644 --- a/src/framework/mlt_consumer.c +++ b/src/framework/mlt_consumer.c @@ -293,8 +293,7 @@ mlt_frame mlt_consumer_get_frame( mlt_consumer this ) // Aspect ratio and other jiggery pokery mlt_properties_set_double( frame_properties, "consumer_aspect_ratio", mlt_properties_get_double( properties, "aspect_ratio" ) ); - if ( mlt_properties_get_int( properties, "progressive" ) || mlt_properties_get_int( properties, "deinterlace" ) ) - mlt_properties_set_int( frame_properties, "consumer_deinterlace", 1 ); + mlt_properties_set_int( frame_properties, "consumer_deinterlace", mlt_properties_get_int( properties, "progressive" ) | mlt_properties_get_int( properties, "deinterlace" ) ); } // Return the frame @@ -366,7 +365,6 @@ static void *consumer_read_ahead_thread( void *arg ) { samples = mlt_sample_calculator( fps, frequency, counter++ ); mlt_frame_get_audio( frame, &pcm, &afmt, &frequency, &channels, &samples ); - frame->get_audio = NULL; } mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "rendered", 1 ); @@ -439,7 +437,6 @@ static void *consumer_read_ahead_thread( void *arg ) { samples = mlt_sample_calculator( fps, frequency, counter++ ); mlt_frame_get_audio( frame, &pcm, &afmt, &frequency, &channels, &samples ); - frame->get_audio = NULL; } // Increment the time take for this frame @@ -639,22 +636,26 @@ void mlt_consumer_close( mlt_consumer this ) // Get the childs close function void ( *consumer_close )( ) = this->close; - // Just in case... - mlt_consumer_stop( this ); - - // Make sure it only gets called once - this->close = NULL; - this->parent.close = NULL; - - // Destroy the push mutex and condition - pthread_cond_broadcast( &this->put_cond ); - pthread_mutex_destroy( &this->put_mutex ); - pthread_cond_destroy( &this->put_cond ); + if ( consumer_close ) + { + // Just in case... + mlt_consumer_stop( this ); - // Call the childs close if available - if ( consumer_close != NULL ) + this->close = NULL; consumer_close( this ); + } else + { + + // Make sure it only gets called once + this->parent.close = NULL; + + // Destroy the push mutex and condition + pthread_cond_broadcast( &this->put_cond ); + pthread_mutex_destroy( &this->put_mutex ); + pthread_cond_destroy( &this->put_cond ); + mlt_service_close( &this->parent ); + } } }