[FFmpeg-devel] [PATCH] cmdutils: silence unused warnings under --disable-swscale, --disable-swresample

Ganesh Ajjanagadde gajjanagadde at gmail.com
Sat Oct 3 15:21:13 CEST 2015


On Sat, Oct 3, 2015 at 7:52 AM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> Hi,
>
> On Sat, Oct 3, 2015 at 8:45 AM, Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> wrote:
>>
>> On Sat, Oct 3, 2015 at 7:42 AM, Ronald S. Bultje <rsbultje at gmail.com>
>> wrote:
>> > Hi,
>> >
>> > On Sat, Oct 3, 2015 at 8:39 AM, Ganesh Ajjanagadde
>> > <gajjanagadde at gmail.com>
>> > wrote:
>> >>
>> >> On Sat, Sep 26, 2015 at 9:57 AM, Ganesh Ajjanagadde
>> >> <gajjanagadde at gmail.com> wrote:
>> >> > On Sat, Sep 19, 2015 at 10:20 AM, Ganesh Ajjanagadde
>> >> > <gajjanagadde at gmail.com> wrote:
>> >> >> This patch silences such warnings by placing initializations under a
>> >> >> header guard,
>> >> >> see e.g
>> >> >>
>> >> >>
>> >> >> http://fate.ffmpeg.org/log.cgi?time=20150919095430&log=compile&slot=x86_64-archlinux-gcc-disableswscale,
>> >> >>
>> >> >>
>> >> >> http://fate.ffmpeg.org/log.cgi?time=20150919095048&log=compile&slot=x86_64-archlinux-gcc-disableswresample
>> >> >> for examples of such warnings.
>> >> >> It also has the benefit of placing library specific #defines next to
>> >> >> each other.
>> >> >>
>> >> >> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
>> >> >> ---
>> >> >>  cmdutils.c | 9 ++++++---
>> >> >>  1 file changed, 6 insertions(+), 3 deletions(-)
>> >> >>
>> >> >> diff --git a/cmdutils.c b/cmdutils.c
>> >> >> index b696008..38d6334 100644
>> >> >> --- a/cmdutils.c
>> >> >> +++ b/cmdutils.c
>> >> >> @@ -533,7 +533,12 @@ int opt_default(void *optctx, const char *opt,
>> >> >> const char *arg)
>> >> >>  #if CONFIG_AVRESAMPLE
>> >> >>      const AVClass *rc = avresample_get_class();
>> >> >>  #endif
>> >> >> -    const AVClass *sc, *swr_class;
>> >> >> +#if CONFIG_SWSCALE
>> >> >> +    const AVClass *sc = sws_get_class();
>> >> >> +#endif
>> >> >> +#if CONFIG_SWRESAMPLE
>> >> >> +    const AVClass *swr_class = swr_get_class();
>> >> >> +#endif
>> >> >>
>> >> >>      if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
>> >> >>          av_log_set_level(AV_LOG_DEBUG);
>> >> >> @@ -557,7 +562,6 @@ int opt_default(void *optctx, const char *opt,
>> >> >> const char *arg)
>> >> >>          consumed = 1;
>> >> >>      }
>> >> >>  #if CONFIG_SWSCALE
>> >> >> -    sc = sws_get_class();
>> >> >>      if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
>> >> >>                           AV_OPT_SEARCH_CHILDREN |
>> >> >> AV_OPT_SEARCH_FAKE_OBJ))) {
>> >> >>          struct SwsContext *sws = sws_alloc_context();
>> >> >> @@ -579,7 +583,6 @@ int opt_default(void *optctx, const char *opt,
>> >> >> const char *arg)
>> >> >>      }
>> >> >>  #endif
>> >> >>  #if CONFIG_SWRESAMPLE
>> >> >> -    swr_class = swr_get_class();
>> >> >>      if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
>> >> >>                                      AV_OPT_SEARCH_CHILDREN |
>> >> >> AV_OPT_SEARCH_FAKE_OBJ))) {
>> >> >>          struct SwrContext *swr = swr_alloc();
>> >> >> --
>> >> >> 2.5.2
>> >> >>
>> >> >
>> >> > ping
>> >>
>> >> been a week; hence ping again.
>> >
>> >
>> > Patch is fine with me. Do you have commit access?
>>
>> Technically I do, but some devs are not comfortable with me exercising
>> it at the moment. I plan to exercise it only when there are no
>> objections from anyone. As such, at the moment, please continue to
>> push my patches.
>
>
> Huh? What are they afraid of?

Hendrik (the only person currently with concerns) felt it is slightly
premature since I have been involved with FFmpeg for only 4 months. I
take any objection of this kind seriously as I do not want any
animosity or disagreement regarding development. These kinds of
things, sufficiently amplified over a period of time and multiple
instances, can lead to pain like the fork. I do not wish to go in that
direction however slight it may appear at the moment.

In fact, IMHO this is best done via a call for a "decision" by the
committee on the lines of Nicolas's proposal.

>
> You can push this patch yourself, it's harmless and consistent with the
> customs around it used for other libraries. There is nothing controversial
> in here. If not, you can blame me for saying it's ok.
>
> Ronald


More information about the ffmpeg-devel mailing list