Opened 7 weeks ago

Closed 4 weeks ago

Last modified 4 weeks ago

#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)

main.log (644.5 KB) - added by MaurizioLoreti 7 weeks ago.
New.log (554.7 KB) - added by MaurizioLoreti 4 weeks ago.

Download all attachments as: .zip

Change History (8)

Changed 7 weeks ago by MaurizioLoreti

Attachment: main.log added

comment:1 Changed 7 weeks ago by ryandesign (Ryan Carsten Schmidt)

Cc: dbevans added; Liontooth devans@… removed
Owner: set to Liontooth
Status: newassigned
Summary: transcode-1.1.7_29 fails to buildtranscode @1.1.7_29: error: call to undeclared function 'av_audio_resample_init'
:info:build filter_resample.c:114:24: error: call to undeclared function 'av_audio_resample_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
:info:build     pd->resample_ctx = av_audio_resample_init(vob->a_chan, vob->a_chan,
:info:build                        ^

comment:2 Changed 6 weeks 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:3 Changed 4 weeks ago by MaurizioLoreti

Three weeks have passed. News, anyone?

comment:4 in reply to:  2 Changed 4 weeks 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 4 weeks 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.

Last edited 4 weeks ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

Changed 4 weeks ago by MaurizioLoreti

Attachment: New.log added

comment:6 Changed 4 weeks ago by ryandesign (Ryan Carsten Schmidt)

Resolution: duplicate
Status: assignedclosed

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.

Last edited 4 weeks ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)
Note: See TracTickets for help on using tickets.