[PATCH 1/2] fftools/ffmpeg_opt: hide a few deprecation warnings.
Signed-off-by: Nicolas George <george@nsup.org> --- fftools/ffmpeg_opt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 71063cc443..5ce70db23e 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -34,6 +34,7 @@ #include "libavutil/avstring.h" #include "libavutil/avutil.h" #include "libavutil/channel_layout.h" +#include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/fifo.h" #include "libavutil/mathematics.h" @@ -796,6 +797,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) if(!ist->dec) ist->dec = avcodec_find_decoder(par->codec_id); #if FF_API_LOWRES +FF_DISABLE_DEPRECATION_WARNINGS if (st->codec->lowres) { ist->dec_ctx->lowres = st->codec->lowres; ist->dec_ctx->width = st->codec->width; @@ -803,6 +805,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) ist->dec_ctx->coded_width = st->codec->coded_width; ist->dec_ctx->coded_height = st->codec->coded_height; } +FF_ENABLE_DEPRECATION_WARNINGS #endif // avformat_find_stream_info() doesn't set this for us anymore. @@ -2398,9 +2401,12 @@ loop_end: if ((ost->stream_copy || ost->attachment_filename) && (e = av_dict_get(o->g->codec_opts, "flags", NULL, AV_DICT_IGNORE_SUFFIX)) - && (!e->key[5] || check_stream_specifier(oc, ost->st, e->key+6))) + && (!e->key[5] || check_stream_specifier(oc, ost->st, e->key+6))) { +FF_DISABLE_DEPRECATION_WARNINGS if (av_opt_set(ost->st->codec, "flags", e->value, 0) < 0) exit_program(1); +FF_ENABLE_DEPRECATION_WARNINGS + } } #endif -- 2.24.0
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 } if (st->disposition & AV_DISPOSITION_DEFAULT) -- 2.24.0
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)
Nicolas George (12019-12-08):
Signed-off-by: Nicolas George <george@nsup.org> --- libavformat/dump.c | 6 ++++++ 1 file changed, 6 insertions(+)
Ping? Will apply next time I think about it if nobody objects. Regards, -- Nicolas George
Nicolas George:
Nicolas George (12019-12-08):
Signed-off-by: Nicolas George <george@nsup.org> --- libavformat/dump.c | 6 ++++++ 1 file changed, 6 insertions(+)
Ping? Will apply next time I think about it if nobody objects.
Regards,
Too late. See 202e06870eb4bbc4636aff5f461c1a0654ec2435. - Andreas
On 12/8/2019 8:47 AM, Nicolas George wrote:
Signed-off-by: Nicolas George <george@nsup.org> --- fftools/ffmpeg_opt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 71063cc443..5ce70db23e 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -34,6 +34,7 @@ #include "libavutil/avstring.h" #include "libavutil/avutil.h" #include "libavutil/channel_layout.h" +#include "libavutil/internal.h" #include "libavutil/intreadwrite.h" #include "libavutil/fifo.h" #include "libavutil/mathematics.h" @@ -796,6 +797,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) if(!ist->dec) ist->dec = avcodec_find_decoder(par->codec_id); #if FF_API_LOWRES +FF_DISABLE_DEPRECATION_WARNINGS if (st->codec->lowres) { ist->dec_ctx->lowres = st->codec->lowres; ist->dec_ctx->width = st->codec->width; @@ -803,6 +805,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) ist->dec_ctx->coded_width = st->codec->coded_width; ist->dec_ctx->coded_height = st->codec->coded_height; } +FF_ENABLE_DEPRECATION_WARNINGS #endif
// avformat_find_stream_info() doesn't set this for us anymore. @@ -2398,9 +2401,12 @@ loop_end:
if ((ost->stream_copy || ost->attachment_filename) && (e = av_dict_get(o->g->codec_opts, "flags", NULL, AV_DICT_IGNORE_SUFFIX)) - && (!e->key[5] || check_stream_specifier(oc, ost->st, e->key+6))) + && (!e->key[5] || check_stream_specifier(oc, ost->st, e->key+6))) { +FF_DISABLE_DEPRECATION_WARNINGS if (av_opt_set(ost->st->codec, "flags", e->value, 0) < 0) exit_program(1); +FF_ENABLE_DEPRECATION_WARNINGS
Last time i tried to silence deprecation warnings on fftool/* files it broke compilation in some cases/compilers, since apparently the __pragma() these expand into would clash with something else. I don't recall what compiler, though.
+ } } #endif
James Almer (12019-12-08):
Last time i tried to silence deprecation warnings on fftool/* files it broke compilation in some cases/compilers, since apparently the __pragma() these expand into would clash with something else. I don't recall what compiler, though.
That is annoying. Well, I think I will keep this patch in my tree for working but not push it. Thanks. Regards, -- Nicolas George
participants (3)
-
Andreas Rheinhardt -
James Almer -
Nicolas George