+/** An alternative method to feed frames into the consumer - only valid if
+ the consumer itself is not connected.
+*/
+
+int mlt_consumer_put_frame( mlt_consumer this, mlt_frame frame )
+{
+ int error = 1;
+
+ // Get the service assoicated to the consumer
+ mlt_service service = MLT_CONSUMER_SERVICE( this );
+
+ if ( mlt_service_producer( service ) == NULL )
+ {
+ struct timeval now;
+ struct timespec tm;
+ pthread_mutex_lock( &this->put_mutex );
+ while ( this->put_active && this->put != NULL )
+ {
+ gettimeofday( &now, NULL );
+ tm.tv_sec = now.tv_sec + 1;
+ tm.tv_nsec = now.tv_usec * 1000;
+ pthread_cond_timedwait( &this->put_cond, &this->put_mutex, &tm );
+ }
+ if ( this->put_active && this->put == NULL )
+ this->put = frame;
+ else
+ mlt_frame_close( frame );
+ pthread_cond_broadcast( &this->put_cond );
+ pthread_mutex_unlock( &this->put_mutex );
+ }
+ else
+ {
+ mlt_frame_close( frame );
+ }
+
+ return error;
+}
+
+/** Protected method for consumer to get frames from connected service