Opened 5 years ago

Closed 5 years ago

#482 closed defect (fixed)

make fails if --disable-swscale, as cmdutils.c invokes sws_get_class without #if CONFIG_SWSCALE

Reported by: skierpage Owned by:
Priority: normal Component: build system
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

(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.

Change History (1)

comment:1 Changed 5 years ago by cehoyos

  • Resolution set to fixed
  • Status changed from new to closed

Should be fixed.

Note: See TracTickets for help on using tickets.