X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_consumer.c;h=93afe447d6a13c81ea9b00cb98c29d4799aa6d76;hb=3902731cb8a9622204d584c4962c74e2a5a35428;hp=57c5b1df8f9a891550bb4aacf4983eef33073d36;hpb=43b8637d43111412e4de944a4eeb3668ab838f9b;p=melted diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c index 57c5b1d..93afe44 100644 --- a/src/framework/mlt_consumer.c +++ b/src/framework/mlt_consumer.c @@ -1,8 +1,9 @@ /** * \file mlt_consumer.c * \brief abstraction for all consumer services + * \see mlt_consumer_s * - * Copyright (C) 2003-2008 Ushodaya Enterprises Limited + * Copyright (C) 2003-2009 Ushodaya Enterprises Limited * \author Charles Yates * * This library is free software; you can redistribute it and/or @@ -25,6 +26,7 @@ #include "mlt_producer.h" #include "mlt_frame.h" #include "mlt_profile.h" +#include "mlt_log.h" #include #include @@ -407,7 +409,8 @@ int mlt_consumer_start( mlt_consumer this ) // Check and run an ante command if ( mlt_properties_get( properties, "ante" ) ) - system( mlt_properties_get( properties, "ante" ) ); + if ( system( mlt_properties_get( properties, "ante" ) ) == -1 ) + mlt_log( MLT_CONSUMER_SERVICE( this ), MLT_LOG_ERROR, "system(%s) failed!\n", mlt_properties_get( properties, "ante" ) ); // Set the real_time preference this->real_time = mlt_properties_get_int( properties, "real_time" ); @@ -924,22 +927,21 @@ int mlt_consumer_stop( mlt_consumer this ) { // Get the properies mlt_properties properties = MLT_CONSUMER_PROPERTIES( this ); - char *debug = mlt_properties_get( MLT_CONSUMER_PROPERTIES( this ), "debug" ); // Just in case... - if ( debug ) fprintf( stderr, "%s: stopping put waiting\n", debug ); + mlt_log( MLT_CONSUMER_SERVICE( this ), MLT_LOG_DEBUG, "stopping put waiting\n" ); pthread_mutex_lock( &this->put_mutex ); this->put_active = 0; pthread_cond_broadcast( &this->put_cond ); pthread_mutex_unlock( &this->put_mutex ); // Stop the consumer - if ( debug ) fprintf( stderr, "%s: stopping consumer\n", debug ); + mlt_log( MLT_CONSUMER_SERVICE( this ), MLT_LOG_DEBUG, "stopping consumer\n" ); if ( this->stop != NULL ) this->stop( this ); // Check if the user has requested real time or not and stop if necessary - if ( debug ) fprintf( stderr, "%s: stopping read_ahead\n", debug ); + mlt_log( MLT_CONSUMER_SERVICE( this ), MLT_LOG_DEBUG, "stopping read_ahead\n" ); if ( mlt_properties_get_int( properties, "real_time" ) ) consumer_read_ahead_stop( this ); @@ -948,9 +950,10 @@ int mlt_consumer_stop( mlt_consumer this ) // Check and run a post command if ( mlt_properties_get( properties, "post" ) ) - system( mlt_properties_get( properties, "post" ) ); + if (system( mlt_properties_get( properties, "post" ) ) == -1 ) + mlt_log( MLT_CONSUMER_SERVICE( this ), MLT_LOG_ERROR, "system(%s) failed!\n", mlt_properties_get( properties, "post" ) ); - if ( debug ) fprintf( stderr, "%s: stopped\n", debug ); + mlt_log( MLT_CONSUMER_SERVICE( this ), MLT_LOG_DEBUG, "stopped\n" ); return 0; }