[FFmpeg-devel] [PATCH 1/2] avutil/internal: Add ff_elog()

Paul B Mahol onemda at gmail.com
Thu Feb 23 09:08:32 EET 2017


On 2/22/17, Michael Niedermayer <michael at niedermayer.cc> wrote:
> This enables the extra error messages in case of DEBUG or high assrtion
> levels.
> High assertion levels imply slow checks in inner loops so any extra error
> should
> be insignificant.
> Is it preferred to have a separate switch for ff_elog() so it doesnt depend
> on
> DEBUG/assertion level ?
>
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
>  libavutil/internal.h | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/libavutil/internal.h b/libavutil/internal.h
> index 7780a9a791..208f8f474f 100644
> --- a/libavutil/internal.h
> +++ b/libavutil/internal.h
> @@ -262,6 +262,12 @@ void avpriv_request_sample(void *avc,
>  #   define ff_dlog(ctx, ...) do { if (0) av_log(ctx, AV_LOG_DEBUG,
> __VA_ARGS__); } while (0)
>  #endif
>
> +#if defined(DEBUG) || ASSERT_LEVEL > 1
> +#   define ff_elog(ctx, ...) av_log(ctx, AV_LOG_ERROR, __VA_ARGS__)
> +#else
> +#   define ff_elog(ctx, ...) do { if (0) av_log(ctx, AV_LOG_ERROR,
> __VA_ARGS__); } while (0)
> +#endif
> +

I guess this is fine.


More information about the ffmpeg-devel mailing list