[FFmpeg-devel] [PATCH] In video_thread(), disable logging of rescaled timestamps if DEBUG is not enabled.

Måns Rullgård mans
Sun Jan 30 18:55:11 CET 2011


Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:

> From d6cb9e59ced8570d7d19ad369968672d61c25703 Mon Sep 17 00:00:00 2001
> From: Stefano Sabatini <stefano.sabatini-lala at poste.it>
> Date: Sat, 22 Jan 2011 15:35:00 +0100
> Subject: [PATCH] In ffplay:video_thread(), use av_dlog() for timestamp logging.
>
> Disable logging of rescaled timestamps if DEBUG is not enabled.
> Avoid debug log spamming with -loglevel debug.
> ---
>  ffplay.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/ffplay.c b/ffplay.c
> index 840df66..edc6097 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -58,6 +58,7 @@
>  const char program_name[] = "FFplay";
>  const int program_birth_year = 2003;
>  
> +//#define DEBUG
>  //#define DEBUG_SYNC
>  
>  #define MAX_QUEUE_SIZE (15 * 1024 * 1024)
> @@ -1853,12 +1854,12 @@ static int video_thread(void *arg)
>          }
>  
>          if (av_cmp_q(tb, is->video_st->time_base)) {
> -            int64_t pts1 = pts_int;
> +            av_unused int64_t pts1 = pts_int;
>              pts_int = av_rescale_q(pts_int, tb, is->video_st->time_base);
> -            av_log(NULL, AV_LOG_DEBUG, "video_thread(): "
> -                   "tb:%d/%d pts:%"PRId64" -> tb:%d/%d pts:%"PRId64"\n",
> -                   tb.num, tb.den, pts1,
> -                   is->video_st->time_base.num, is->video_st->time_base.den, pts_int);
> +            av_dlog(NULL, "video_thread(): "
> +                    "tb:%d/%d pts:%"PRId64" -> tb:%d/%d pts:%"PRId64"\n",
> +                    tb.num, tb.den, pts1,
> +                    is->video_st->time_base.num, is->video_st->time_base.den, pts_int);

You could put the av_rescale_q() directly as an argument to
av_dlog() and avoid needing to use av_unused.  I can make this change
if desired, no need for another patch.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list