[FFmpeg-devel] [PATCH] avutil/log: avoid build error if valgrind was removed after configure

Andreas Oberritter obi at saftware.de
Fri Dec 9 03:50:47 EET 2016


In an automated build system, where valgrind and ffmpeg get updated in
parallel, a race condition may occur in which valgrind/valgrind.h is
available when configure runs but not if libavutil/log.c gets compiled.

Using CONFIG_VALGRIND_BACKTRACE helps to avoid this problem, because
it allows to prevent the inclusion of the autodetected valgrind.h by
using a configure switch.

Signed-off-by: Andreas Oberritter <obi at saftware.de>
---
Please put me on CC: when replying, as I'm not subscribed to the list.

 libavutil/log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/log.c b/libavutil/log.c
index 44c11cb..202c0f1 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -47,7 +47,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 
 #define LINE_SZ 1024
 
-#if HAVE_VALGRIND_VALGRIND_H
+#if CONFIG_VALGRIND_BACKTRACE
 #include <valgrind/valgrind.h>
 /* this is the log level at which valgrind will output a full backtrace */
 #define BACKTRACE_LOGLEVEL AV_LOG_ERROR
-- 
2.7.4



More information about the ffmpeg-devel mailing list