[FFmpeg-devel] [PATCH] lavf/mp3dec: avoid printing useless message in default log level

wm4 nfxjfg at googlemail.com
Tue Mar 8 15:53:15 CET 2016


On Tue,  8 Mar 2016 15:36:06 +0100
Moritz Barsnick <barsnick at gmx.net> wrote:

> "Skipping 0 bytes of junk" is useless to the user, and essentially
> indicates a NOP. At 0 bytes, this message is now pushed back to
> the debug log level.
> 
> Signed-off-by: Moritz Barsnick <barsnick at gmx.net>
> ---
>  libavformat/mp3dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
> index adc3d2a..2caf78b 100644
> --- a/libavformat/mp3dec.c
> +++ b/libavformat/mp3dec.c
> @@ -388,7 +388,7 @@ static int mp3_read_header(AVFormatContext *s)
>              if (ret >= 0 &&
>                  (header & SAME_HEADER_MASK) == (header2 & SAME_HEADER_MASK))
>              {
> -                av_log(s, AV_LOG_INFO, "Skipping %d bytes of junk at %"PRId64".\n", i, off);
> +                av_log(s, i > 0 ? AV_LOG_INFO : AV_LOG_DEBUG, "Skipping %d bytes of junk at %"PRId64".\n", i, off);
>                  ret = avio_seek(s->pb, off + i, SEEK_SET);
>                  if (ret < 0)
>                      return ret;

AV_LOG_INFO is effectively a verbose level anyway, because FFmpeg
prints a lot of stuff at level INFO, so I'm not sure how useful it is.
But AV_LOG_LEVEL_DEBUG should definitely be replaced with
AV_LOG_LEVEL_VERBOSE.


More information about the ffmpeg-devel mailing list