#69660 closed defect (duplicate)
transcode @1.1.7_29: error: call to undeclared function 'av_audio_resample_init'
Reported by: | MaurizioLoreti | Owned by: | Liontooth (David Liontooth) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.9.2 |
Keywords: | Cc: | dbevans (David B. Evans) | |
Port: | transcode |
Description
As said: transcode-1.1.7_29 fails to build on a Mac Studio M2 Pro. Here follows the log file:
Attachments (2)
Change History (8)
Changed 10 months ago by MaurizioLoreti
comment:1 Changed 10 months ago by ryandesign (Ryan Carsten Schmidt)
Cc: | dbevans added; Liontooth devans@… removed |
---|---|
Owner: | set to Liontooth |
Status: | new → assigned |
Summary: | transcode-1.1.7_29 fails to build → transcode @1.1.7_29: error: call to undeclared function 'av_audio_resample_init' |
comment:2 follow-up: 4 Changed 9 months ago by MaurizioLoreti
It is not so simple. I edited the port file adding "configure.cflags-append -Wno-implicit-function-declaration", re-computed the checksum and I tried to install. No way.
Any hint?
comment:4 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)
Replying to MaurizioLoreti:
It is not so simple. I edited the port file adding "configure.cflags-append -Wno-implicit-function-declaration", re-computed the checksum and I tried to install. No way.
Suppressing the error is not the solution, but what error did you get next when you tried to do that?
comment:5 Changed 9 months ago by MaurizioLoreti
$ cd $(port dir transcode) $ sudo port edit transcode ... added configure.cflags-append -Wno-implicit-function-declaration ... $ sudo port -d checksum transcode $ sudo port clean transcode $ sudo port upgrade transcode ... Error: Failed to build transcode: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_transcode/transcode/main.log for details. Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug. $
main.log attached.
Changed 9 months ago by MaurizioLoreti
comment:6 Changed 9 months ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → duplicate |
---|---|
Status: | assigned → closed |
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 result of the function is assigned to a variable that is a pointer, not an int
, and the compiler does not allow such a conversion.
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.