From 1825ca868d90ff7f69d9f19c1efe58989f74ac3d Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Tue, 20 Aug 2013 00:18:34 -0700 Subject: [PATCH] Cleanup x264 stats files when "passlogfile" supplied. --- src/modules/avformat/consumer_avformat.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/avformat/consumer_avformat.c b/src/modules/avformat/consumer_avformat.c index d9215d23..ceaa12c6 100644 --- a/src/modules/avformat/consumer_avformat.c +++ b/src/modules/avformat/consumer_avformat.c @@ -2213,6 +2213,18 @@ on_fatal_error: free( full ); free( cwd ); remove( "x264_2pass.log.temp" ); + + // Recent versions of libavcodec/x264 support passlogfile and need cleanup if specified. + if ( !mlt_properties_get( properties, "_logfilename" ) && + mlt_properties_get( properties, "passlogfile" ) ) + { + file = mlt_properties_get( properties, "passlogfile" ); + remove( file ); + full = malloc( strlen( file ) + strlen( ".mbtree" ) + 1 ); + sprintf( full, "%s.mbtree", file ); + remove( full ); + free( full ); + } } while ( ( frame = mlt_deque_pop_back( queue ) ) ) -- 2.39.2