diff mbox

[FFmpeg-devel,2/2] lavf/dump: hide a few deprecation warnings.

Message ID 20191208114759.28289-2-george@nsup.org
State New
Headers show

Commit Message

Nicolas George Dec. 8, 2019, 11:47 a.m. UTC
Signed-off-by: Nicolas George <george@nsup.org>
---
 libavformat/dump.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

James Almer Dec. 8, 2019, 1:21 p.m. UTC | #1
On 12/8/2019 8:47 AM, Nicolas George wrote:
> Signed-off-by: Nicolas George <george@nsup.org>
> ---
>  libavformat/dump.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavformat/dump.c b/libavformat/dump.c
> index 56814ff7d2..fcf8bad63a 100644
> --- a/libavformat/dump.c
> +++ b/libavformat/dump.c
> @@ -479,12 +479,14 @@ static void dump_stream_format(AVFormatContext *ic, int i,
>      }
>  
>      // Fields which are missing from AVCodecParameters need to be taken from the AVCodecContext
> +FF_DISABLE_DEPRECATION_WARNINGS
>      avctx->properties = st->codec->properties;
>      avctx->codec      = st->codec->codec;
>      avctx->qmin       = st->codec->qmin;
>      avctx->qmax       = st->codec->qmax;
>      avctx->coded_width  = st->codec->coded_width;
>      avctx->coded_height = st->codec->coded_height;
> +FF_ENABLE_DEPRECATION_WARNINGS
>  
>      if (separator)
>          av_opt_set(avctx, "dump_separator", separator, 0);
> @@ -519,7 +521,9 @@ static void dump_stream_format(AVFormatContext *ic, int i,
>          int fps = st->avg_frame_rate.den && st->avg_frame_rate.num;
>          int tbr = st->r_frame_rate.den && st->r_frame_rate.num;
>          int tbn = st->time_base.den && st->time_base.num;
> +FF_DISABLE_DEPRECATION_WARNINGS
>          int tbc = st->codec->time_base.den && st->codec->time_base.num;
> +FF_ENABLE_DEPRECATION_WARNINGS
>  
>          if (fps || tbr || tbn || tbc)
>              av_log(NULL, AV_LOG_INFO, "%s", separator);
> @@ -530,8 +534,10 @@ static void dump_stream_format(AVFormatContext *ic, int i,
>              print_fps(av_q2d(st->r_frame_rate), tbn || tbc ? "tbr, " : "tbr");
>          if (tbn)
>              print_fps(1 / av_q2d(st->time_base), tbc ? "tbn, " : "tbn");
> +FF_DISABLE_DEPRECATION_WARNINGS
>          if (tbc)
>              print_fps(1 / av_q2d(st->codec->time_base), "tbc");
> +FF_ENABLE_DEPRECATION_WARNINGS

All these should be wrapped in checks for FF_API_LAVF_AVCTX as well.

LGTM otherwise.

>      }
>  
>      if (st->disposition & AV_DISPOSITION_DEFAULT)
>
diff mbox

Patch

diff --git a/libavformat/dump.c b/libavformat/dump.c
index 56814ff7d2..fcf8bad63a 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -479,12 +479,14 @@  static void dump_stream_format(AVFormatContext *ic, int i,
     }
 
     // Fields which are missing from AVCodecParameters need to be taken from the AVCodecContext
+FF_DISABLE_DEPRECATION_WARNINGS
     avctx->properties = st->codec->properties;
     avctx->codec      = st->codec->codec;
     avctx->qmin       = st->codec->qmin;
     avctx->qmax       = st->codec->qmax;
     avctx->coded_width  = st->codec->coded_width;
     avctx->coded_height = st->codec->coded_height;
+FF_ENABLE_DEPRECATION_WARNINGS
 
     if (separator)
         av_opt_set(avctx, "dump_separator", separator, 0);
@@ -519,7 +521,9 @@  static void dump_stream_format(AVFormatContext *ic, int i,
         int fps = st->avg_frame_rate.den && st->avg_frame_rate.num;
         int tbr = st->r_frame_rate.den && st->r_frame_rate.num;
         int tbn = st->time_base.den && st->time_base.num;
+FF_DISABLE_DEPRECATION_WARNINGS
         int tbc = st->codec->time_base.den && st->codec->time_base.num;
+FF_ENABLE_DEPRECATION_WARNINGS
 
         if (fps || tbr || tbn || tbc)
             av_log(NULL, AV_LOG_INFO, "%s", separator);
@@ -530,8 +534,10 @@  static void dump_stream_format(AVFormatContext *ic, int i,
             print_fps(av_q2d(st->r_frame_rate), tbn || tbc ? "tbr, " : "tbr");
         if (tbn)
             print_fps(1 / av_q2d(st->time_base), tbc ? "tbn, " : "tbn");
+FF_DISABLE_DEPRECATION_WARNINGS
         if (tbc)
             print_fps(1 / av_q2d(st->codec->time_base), "tbc");
+FF_ENABLE_DEPRECATION_WARNINGS
     }
 
     if (st->disposition & AV_DISPOSITION_DEFAULT)