diff mbox series

[FFmpeg-devel,4/4] fftools/ffmpeg: drop an FF_API-guarded block

Message ID 20210126170102.15175-4-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,1/4] mjpegdec: stop setting the QP table | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Anton Khirnov Jan. 26, 2021, 5:01 p.m. UTC
These macros are private and should not be used by external callers.
---
 fftools/ffmpeg_opt.c | 13 -------------
 1 file changed, 13 deletions(-)

Comments

James Almer Jan. 26, 2021, 5:19 p.m. UTC | #1
On 1/26/2021 2:01 PM, Anton Khirnov wrote:
> These macros are private and should not be used by external callers.
> ---
>   fftools/ffmpeg_opt.c | 13 -------------
>   1 file changed, 13 deletions(-)
> 
> diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
> index bf2eb26246..472016b93c 100644
> --- a/fftools/ffmpeg_opt.c
> +++ b/fftools/ffmpeg_opt.c
> @@ -2423,19 +2423,6 @@ loop_end:
>           avio_closep(&pb);
>       }
>   
> -#if FF_API_LAVF_AVCTX
> -    for (i = nb_output_streams - oc->nb_streams; i < nb_output_streams; i++) { //for all streams of this output file
> -        AVDictionaryEntry *e;
> -        ost = output_streams[i];
> -
> -        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)))
> -            if (av_opt_set(ost->st->codec, "flags", e->value, 0) < 0)
> -                exit_program(1);
> -    }
> -#endif

I think this is here for the sake of a warning in libavformat/mux.c, 
where if you use -flags +bitexact but not -fflags +bitexact it would 
tell you to check that's what you intended to do.

If you remove this chunk, then might as well remove the warning in mux.c
It's also guarded by a FF_API_LAVF_AVCTX check for obvious reasons.

> -
>       if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) {
>           av_dump_format(oc, nb_output_files - 1, oc->url, 1);
>           av_log(NULL, AV_LOG_ERROR, "Output file #%d does not contain any stream\n", nb_output_files - 1);
>
Anton Khirnov Feb. 24, 2021, 9:03 a.m. UTC | #2
Quoting James Almer (2021-01-26 18:19:46)
> On 1/26/2021 2:01 PM, Anton Khirnov wrote:
> > These macros are private and should not be used by external callers.
> > ---
> >   fftools/ffmpeg_opt.c | 13 -------------
> >   1 file changed, 13 deletions(-)
> > 
> > diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
> > index bf2eb26246..472016b93c 100644
> > --- a/fftools/ffmpeg_opt.c
> > +++ b/fftools/ffmpeg_opt.c
> > @@ -2423,19 +2423,6 @@ loop_end:
> >           avio_closep(&pb);
> >       }
> >   
> > -#if FF_API_LAVF_AVCTX
> > -    for (i = nb_output_streams - oc->nb_streams; i < nb_output_streams; i++) { //for all streams of this output file
> > -        AVDictionaryEntry *e;
> > -        ost = output_streams[i];
> > -
> > -        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)))
> > -            if (av_opt_set(ost->st->codec, "flags", e->value, 0) < 0)
> > -                exit_program(1);
> > -    }
> > -#endif
> 
> I think this is here for the sake of a warning in libavformat/mux.c, 
> where if you use -flags +bitexact but not -fflags +bitexact it would 
> tell you to check that's what you intended to do.
> 
> If you remove this chunk, then might as well remove the warning in mux.c
> It's also guarded by a FF_API_LAVF_AVCTX check for obvious reasons.

Meh. Guess I'll postpone both until the actual bump then.
diff mbox series

Patch

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index bf2eb26246..472016b93c 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -2423,19 +2423,6 @@  loop_end:
         avio_closep(&pb);
     }
 
-#if FF_API_LAVF_AVCTX
-    for (i = nb_output_streams - oc->nb_streams; i < nb_output_streams; i++) { //for all streams of this output file
-        AVDictionaryEntry *e;
-        ost = output_streams[i];
-
-        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)))
-            if (av_opt_set(ost->st->codec, "flags", e->value, 0) < 0)
-                exit_program(1);
-    }
-#endif
-
     if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) {
         av_dump_format(oc, nb_output_files - 1, oc->url, 1);
         av_log(NULL, AV_LOG_ERROR, "Output file #%d does not contain any stream\n", nb_output_files - 1);