[FFmpeg-trac] #482(build system:new): make fails if --disable-swscale, as cmdutils.c invokes sws_get_class without #if CONFIG_SWSCALE

FFmpeg trac at avcodec.org
Sun Sep 18 01:07:31 CEST 2011


#482: make fails if --disable-swscale, as cmdutils.c invokes sws_get_class
without #if CONFIG_SWSCALE
-------------------------------------+-------------------------------------
             Reporter:  skierpage    |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  build        |                  Version:  git-
  system                             |  master
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 (I'm building from git to debug some QCELP audio playback problems.)
 From "Get FFmpeg" I downloaded git snapshot. I don't need all of ffmpeg so
 I tried

 % /configure --prefix=/home/skierpage/src/ffmpeg --disable-swscale
 --disable-avfilter --disable-network
 % make

 This errors with
 {{{
 cmdutils.o: In function `opt_default':
 /home/skierpage/src/ffmpeg-HEAD-9a9ceb8/cmdutils.c:314: undefined
 reference to `sws_get_class'
 collect2: ld returned 1 exit status
 make: *** [ffprobe_g] Error 1
 }}}

 I'm pretty sure the problem is sws_get_class() is defined in libswcale, so
 if that's disabled with --disable-swscale , then cmdutils.c won't compile.
 Other invocations of sws_ functions are guarded with #if CONFIG_SWSCALE. A
 dumb patch that allows make to complete and doesn't immediately crash
 ffprobe is
 {{{
 --- cmdutils.c.org      2011-09-17 13:36:43.000000000 -0700
 +++ cmdutils.c  2011-09-17 15:54:37.453134577 -0700
 @@ -311,6 +311,11 @@
      const AVOption *oc, *of, *os;
      char opt_stripped[128];
      const char *p;
 +// SPage: avoid sws_get_class failure
 +#if !CONFIG_SWSCALE
 +#   define sws_get_class(x)  0
 +#endif
 +
      const AVClass *cc = avcodec_get_class(), *fc = avformat_get_class(),
 *sc = sws_get_class();

      if (!(p = strchr(opt, ':')))
 }}}

 I hope this helps. Thank you for ffmpeg's massive AV format support.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/482>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list