Option to hold feed processing on a track
[melted] / src / framework / mlt_properties.c
index 01c4ba2..df2e7b4 100644 (file)
@@ -47,7 +47,7 @@ property_list;
 /** Memory leak checks.
 */
 
-//#define _MLT_PROPERTY_CHECKS_
+//#define _MLT_PROPERTY_CHECKS_ 2
 
 #ifdef _MLT_PROPERTY_CHECKS_
 static int properties_created = 0;
@@ -202,6 +202,19 @@ int mlt_properties_dec_ref( mlt_properties this )
        return 0;
 }
 
+/** Return the ref count of this object.
+*/
+
+int mlt_properties_ref_count( mlt_properties this )
+{
+       if ( this != NULL )
+       {
+               property_list *list = this->local;
+               return list->ref_count;
+       }
+       return 0;
+}
+
 /** Allow the specification of a mirror.
 */
 
@@ -653,7 +666,7 @@ void mlt_properties_dump( mlt_properties this, FILE *output )
 
 void mlt_properties_debug( mlt_properties this, char *title, FILE *output )
 {
-       fprintf( stderr, "%s: ", title );
+       fprintf( output, "%s: ", title );
        if ( this != NULL )
        {
                property_list *list = this->local;
@@ -666,7 +679,7 @@ void mlt_properties_debug( mlt_properties this, char *title, FILE *output )
                                fprintf( output, ", %s=%p", list->name[ i ], mlt_properties_get_data( this, list->name[ i ], NULL ) );
                fprintf( output, " ]" );
        }
-       fprintf( stderr, "\n" );
+       fprintf( output, "\n" );
 }
 
 /** Close the list.
@@ -685,10 +698,12 @@ void mlt_properties_close( mlt_properties this )
                        property_list *list = this->local;
                        int index = 0;
 
-#ifdef _MLT_PROPERTY_CHECKS_
+#if _MLT_PROPERTY_CHECKS_ == 1
                        // Show debug info
                        mlt_properties_debug( this, "Closing", stderr );
+#endif
 
+#ifdef _MLT_PROPERTY_CHECKS_
                        // Increment destroyed count
                        properties_destroyed ++;