Moonbase59 / loudgain

ReplayGain 2.0 loudness normalizer based on the EBU R128/ITU BS.1770 standard (-18 LUFS, FLAC, Ogg, MP2, MP3, MP4, M4A, AAC, ALAC, Opus, ASF, WMA, WAV, AIFF, WavPack, APE)
Other
182 stars 23 forks source link

Build fails because of missing ”av_register_all" function #49

Open mundschenk-at opened 2 years ago

mundschenk-at commented 2 years ago

Apparently the previously deprecated symbol av_register_all has been removed upstream, so the build now fails:

/usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang++ -std=gnu++11 -D_GNU_SOURCE -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/loudgain.dir/src/loudgain.c.o CMakeFiles/loudgain.dir/src/printf.c.o CMakeFiles/loudgain.dir/src/scan.c.o CMakeFiles/loudgain.dir/src/tag.cc.o -o loudgain  /usr/local/lib/libebur128.dylib -lavcodec -lavformat -lswresample -lavutil -ltag -lz 
Undefined symbols for architecture x86_64:
  "_av_register_all", referenced from:
      _scan_init in scan.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [loudgain] Error 1
make[1]: *** [CMakeFiles/loudgain.dir/all] Error 2
make: *** [all] Error 2
hughmcmaster commented 2 years ago

The libavformat function av_register_all was removed in ffmpeg 5.0.

The patch in PR https://github.com/Moonbase59/loudgain/pull/50 will help.

You can also just remove the following lines from src/scan.c since you're linking against libraries provided by ffmpeg 5.0.

   if (avformat_version() < AV_VERSION_INT(58,9,100))
     av_register_all();
mundschenk-at commented 2 years ago

Thank you, I'll see if I can fit that into the Homebrew workflow.

marvin-klein commented 2 years ago

As a workaround, I forked the tap repo and changed the ffmpeg dependency to ffmpeg@4 (see here). One can now install loudgain using brew install marvin-klein/tap/loudgain.

gearhead commented 2 years ago

Please add this to the repo. I can confirm that this builds a binary if these 2 lines in scan.c are removed.