]> git.sesse.net Git - mlt/blobdiff - src/melt/melt.c
Fix superficial cpu usage with melt progress option (used by Kdenlive).
[mlt] / src / melt / melt.c
index 2b1a033873d9279963bd03bb4bdf2ca483b85e51..3d507d8bf8e879ec1154baea972dbbf130485943 100644 (file)
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sched.h>
+#include <libgen.h>
 
 #include <framework/mlt.h>
 
@@ -257,7 +260,7 @@ static void transport( mlt_producer producer, mlt_consumer consumer )
                                }
                        }
 
-                       if ( silent )
+                       if ( silent || progress )
                                nanosleep( &tm, NULL );
                }
 
@@ -557,14 +560,14 @@ query_all:
                basename( argv[0] ) );
        }
 
-       // Close the consumer
-       if ( consumer != NULL )
-               mlt_consumer_close( consumer );
-
        // Close the producer
        if ( melt != NULL )
                mlt_producer_close( melt );
 
+       // Close the consumer
+       if ( consumer != NULL )
+               mlt_consumer_close( consumer );
+
        // Close the factory
        mlt_profile_close( profile );