[Libav-user] SWR_CH_MAX no more exists

wm4 nfxjfg at googlemail.com
Sun Sep 21 15:12:16 CEST 2014


On Sun, 21 Sep 2014 14:57:39 +0200
Julien Durillon <julien.durillon at clever-cloud.com> wrote:

> Hi,
> 
> I'm trying to build a project (ffDiaporama, which I'm not the
> contributor of) that deps on ffmpeg up to 2.1.
> The ffmpeg installed on my laptop is 2.4.
> 
> ffDiaporama has only one error when building against 2.4:
> 
> "error: 'SWR_CH_MAX' was not declared in this scope"
> 
> I did some digging, and I found out that SWR_CH_MAX (documented here:
> http://ffmpeg.org/doxygen/2.4/group__lswr.html )
> Is no more defined in 2.4, because LIBSWRESAMPLE_VERSION_MAJOR = 1
> since ffmpeg 2.4.
> 
> For my build's sake, I made a local patch to ffDiaporama to define
> SWR_CH_MAX if swresample.h does not define it.
> 
> Is SWR_CH_MAX no more to be used? How should I replace it in
> ffDiaporama? I couldn't find any information about that.
> 
> Regards,

The FFmpeg API doesn't impose any maximum channel number, so at least
in theory, it could decode audio tracks with INT_MAX channels.

(Though it looks like libswsresample is still limited to 32 internally?)

If a ffDiaporama needs a static channel limit, the right way is to:

1. define an application-specific constant for the max. channels
   supported by it
2. when decoding or filtering, check if the channel number is not larger
   than the supported number of channels, and if it is, exit with an
   error


More information about the Libav-user mailing list