[MacPorts] #69660: transcode @1.1.7_29: error: call to undeclared function 'av_audio_resample_init'

MacPorts noreply at macports.org
Thu Apr 25 04:58:04 UTC 2024


#69660: transcode @1.1.7_29: error: call to undeclared function
'av_audio_resample_init'
-----------------------------+-----------------------
  Reporter:  MaurizioLoreti  |      Owner:  Liontooth
      Type:  defect          |     Status:  closed
  Priority:  Normal          |  Milestone:
 Component:  ports           |    Version:  2.9.2
Resolution:  duplicate       |   Keywords:
      Port:  transcode       |
-----------------------------+-----------------------
Changes (by ryandesign):

 * status:  assigned => closed
 * resolution:   => duplicate


Comment:

 Right, and the error in the new log is:

 {{{
 filter_resample.c:114:22: error: incompatible integer to pointer
 conversion assigning to 'AVAudioResampleContext *' (aka 'struct
 AVAudioResampleContext *') from 'int' [-Wint-conversion]
     pd->resample_ctx = av_audio_resample_init(vob->a_chan, vob->a_chan,
                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1 error generated.
 }}}

 So first, `av_audio_resample_init` was not declared. By suppressing that
 error, you are telling the compiler that when it encounters the function
 `av_audio_resample_init` that it has never heard of, it should invent a
 function prototype which has the right number of arguments for the call,
 all of which will be assumed to be of type `int`, and having a return type
 `int`. This then immediately fails when the arguments that are actually
 being passed to the function cannot be converted to `int`.

 This is why the solution is not to try to make implicit function
 declarations work somehow. The solution is instead to ''explicitly''
 declare all functions. See WimplicitFunctionDeclaration. In this case,
 `av_audio_resample_init` is an ffmpeg function so an explicit declaration
 of it is probably in an ffmpeg header, which filter_resample.c should be
 including. Obviously this used to work at some point, so something has
 changed, and someone has to figure out what that is. ffmpeg changes often;
 maybe an ffmpeg update changed how this function works or removed it and
 transcode must change its code to adapt.

 In any case, this is a duplicate of your previous bug report #63798 which
 is a duplicate of #61696.

-- 
Ticket URL: <https://trac.macports.org/ticket/69660#comment:6>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list