aqualung
aqualung copied to clipboard
Build failure with 1.1 and ffmpeg 5
Hi,
Forwarding a downstream report in Gentoo. aqualung 1.1 fails to build with ffmpeg 5 like so:
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I../.. -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -pthread -Wall -O2 -march=znver3 -pipe -g -ggdb3 -c -o dec_vorbis.o dec_vorbis.c
dec_lavc.c: In function ‘decode_audio’:
dec_lavc.c:122:15: warning: implicit declaration of function ‘avcodec_decode_audio4’; did you mean ‘avcodec_decode_subtitle2’? [-Wimplicit-function-declaration]
122 | ret = avcodec_decode_audio4(avctx, &frame, &got_frame, avpkt);
| ^~~~~~~~~~~~~~~~~~~~~
| avcodec_decode_subtitle2
dec_lavc.c: In function ‘decode_lavc’:
dec_lavc.c:200:9: warning: implicit declaration of function ‘av_free_packet’; did you mean ‘av_get_packet’? [-Wimplicit-function-declaration]
200 | av_free_packet(&packet);
| ^~~~~~~~~~~~~~
| av_get_packet
dec_lavc.c: In function ‘lavc_decoder_open’:
dec_lavc.c:274:48: error: ‘AVStream’ has no member named ‘codec’
274 | if (pd->avFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
| ^~
dec_lavc.c:282:67: error: ‘AVStream’ has no member named ‘codec’
282 | pd->avCodecCtx = pd->avFormatCtx->streams[pd->audioStream]->codec;
| ^~
dec_lavc.c:292:21: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
292 | pd->avCodec = avcodec_find_decoder(pd->avCodecCtx->codec_id);
| ^
file_decoder.c: In function ‘file_decoder_init’:
file_decoder.c:175:9: warning: implicit declaration of function ‘av_register_all’ [-Wimplicit-function-declaration]
175 | av_register_all();
| ^~~~~~~~~~~~~~~
make[3]: *** [Makefile:477: dec_lavc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/var/tmp/portage/media-sound/aqualung-1.1-r101/work/aqualung-1.1/src/decoder'
make[2]: *** [Makefile:1282: all-recursive] Error 1
make[2]: Leaving directory '/var/tmp/portage/media-sound/aqualung-1.1-r101/work/aqualung-1.1/src'
make[1]: *** [Makefile:444: all-recursive] Error 1
The full log (gzipped) is at https://bugs.gentoo.org/attachment.cgi?id=766043.
Thanks for the report. It would be great to get a pull request to support ffmpeg 5 while keeping current ffmpeg 4 support. Unfortunately, this is not something I'll be able to work on until OpenBSD upgrades to ffmpeg 5. Until ffmpeg 5 support is added, you'll probably want to use --without-lavc
when configuring.
Thanks for the report. It would be great to get a pull request to support ffmpeg 5 while keeping current ffmpeg 4 support. Unfortunately, this is not something I'll be able to work on until OpenBSD upgrades to ffmpeg 5. Until ffmpeg 5 support is added, you'll probably want to use
--without-lavc
when configuring.
I'm working on this now. I can provide you a diff for testing. I came across this issue when checking the upstream status of various ports.
@brad0 That sounds great. If the patch keeps things working with ffmpeg 4 but allows building with ffmpeg 5, I'd be eager to accept it.
@brad0 That sounds great. If the patch keeps things working with ffmpeg 4 but allows building with ffmpeg 5, I'd be eager to accept it.
Sorry I wasn't clear. I was referring to the OpenBSD FFmpeg port.
Sure, if you have a patch for the OpenBSD ffmpeg port, I can test with that and see if I can get aqualung updated to support that.
Anyway, aqualung is one of very few left on my list that needs to be fixed for FFmpeg 5 and newer API. I sent you the port diff for 6.
Yes, thank you for that. I've been fairly busy and haven't had time to test the port you sent, but I'll try to make time in the next week or two.
After considerable work, I was able to get aqualung compiling with ffmpeg 6. I tested it and it crashed at runtime on OpenBSD, due to a MAP_STACK issue:
[aqualung]70584/354291 sp=1a7d8a06d20 inside 1a7d8a53000-1a7d8ad2fff: not MAP_STACK
I then tried with ffmpeg 4 (the version currently in OpenBSD ports) on a different machine and got similar MAP_STACK-related crashes, using a few different file types (aac, avi, mpc (when configured with --without-mpc
)).
I was able to fix the MAP_STACK issue by reducing MAX_AUDIO_FRAME_SIZE, to avoid the lavc decoder trying to use a gigantic stack frame.
I've pushed up the changes, so the master branch should now compile with ffmpeg 6 and ffmpeg 4 (and hopefully ffmpeg 5 as well).
@thesamesam @tomscii @brad0 If you could test the master branch, to confirm this fixes things, that would be great. After some successful test reports, I'd be OK with releasing Aqualung 1.2 with these changes.
Hi,
I just pulled 9ce736e and compiled it. Tried to play a couple .mp4 movie files that I found lying around and it all seems to work. I have libav*-dev libs from debian stable, version "7:4.3.6-0+deb11u1" (whatever that means, I guess ffmpeg 4.3.6).
Many thanks, Tom
You updated to the new channel layout API too. Thanks. I'll test out a bit and get back to you.
Testing with FFmpeg 6 on OpenBSD.
I was able to play a variety of formats (MP3, M4A, FLAC, Ogg Vorbis, AC3, a handful of others) without issue.
Although randomly aqualung crashed a bunch of times. But running it under the debugger, the traces I see when it does crash does not seem like they have anything to do with FFmpeg.
Thanks for the feedback. I'll run with the master branch for a few days, and assuming no problems, release 1.2 later in the week.
Thanks for the feedback. I'll run with the master branch for a few days, and assuming no problems, release 1.2 later in the week.
Thank you.