Message ID | 20191208114759.28289-1-george@nsup.org |
---|---|
State | New |
Headers | show |
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,
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
Signed-off-by: Nicolas George <george@nsup.org> --- fftools/ffmpeg_opt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)