[FFmpeg-devel] [PATCH] ffprobe: Support adding av_log output to frames

James Almer jamrial at gmail.com
Wed Jun 8 05:04:44 CEST 2016


On 5/31/2016 4:23 PM, Michael Niedermayer wrote:
> adding demuxer and other logs should be easy
> This forces single threaded decoding for simplicity
> It also requires pthreads, this could be avoided either with
> some lockless tricks or simply by assuming av_log would never be called from
> another thread.
> 
> doc/ffprobe.xsd update missing (TODO & help welcome)
> 
> Fixes Ticket5521
> 
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  ffprobe.c |  154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 153 insertions(+), 1 deletion(-)
> 
> diff --git a/ffprobe.c b/ffprobe.c
> index a7e329c..07b61ec 100644
> --- a/ffprobe.c
> +++ b/ffprobe.c
> @@ -49,6 +49,19 @@
>  #include "libpostproc/postprocess.h"
>  #include "cmdutils.h"
>  
> +#if HAVE_PTHREADS
> +#  include <pthread.h>
> +#else
> +#  ifdef pthread_mutex_lock
> +#    undef pthread_mutex_lock
> +#  endif
> +#  define pthread_mutex_lock(a)
> +#  ifdef pthread_mutex_unlock
> +#    undef pthread_mutex_unlock
> +#  endif
> +#  define pthread_mutex_unlock(a)
> +#endif

Why are you not using the compat wrappers here? These are simple
mutex locks that don't even use static init, so i don't see why
they wouldn't work with w32threads or os2threads.

You can either include the compat headers directly and keep using
pthread_mutex*, or use lavu's thread.h and use ff_mutex_*


More information about the ffmpeg-devel mailing list