Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build with ffmpeg 5.0 #730

Closed
Unit193 opened this issue Feb 1, 2022 · 7 comments
Closed

Fails to build with ffmpeg 5.0 #730

Unit193 opened this issue Feb 1, 2022 · 7 comments
Labels

Comments

@Unit193
Copy link

Unit193 commented Feb 1, 2022

Subject of the issue

As reported downstream in Debian, pianobar currently fails to build with ffmpeg 5.0.

Your environment

  • 2020.11.28 (also tried on git master)
  • Build attempted on Debian unstable, with ffmpeg from experimental
  • ffmpeg 5.0

Build log as included in the bug report, pianobar 2020.11.28 (git master can be supplied as well.)

| c99 -c -o src/ui_dispatch.o -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -I src/libpiano -I/usr/include/x86_64-linux-gnu -I/usr/include/x86_64-linux-gnu  -I/usr/include/json-c  -MMD -MF src/ui_dispatch.d -MP src/ui_dispatch.c
| In file included from src/ui.h:31,
|                  from src/ui_act.c:34:
| src/player.h:71:9: error: unknown type name ‘AVCodecContext’
|    71 |         AVCodecContext *cctx;
|       |         ^~~~~~~~~~~~~~
| make[2]: *** [Makefile:109: src/ui_act.o] Error 1
| make[2]: *** Waiting for unfinished jobs....
| In file included from src/ui.h:31,
|                  from src/settings.c:42:
| src/player.h:71:9: error: unknown type name ‘AVCodecContext’
|    71 |         AVCodecContext *cctx;
|       |         ^~~~~~~~~~~~~~
| make[2]: *** [Makefile:109: src/settings.o] Error 1
| In file included from src/main.h:30,
|                  from src/main.c:53:
| src/player.h:71:9: error: unknown type name ‘AVCodecContext’
|    71 |         AVCodecContext *cctx;
|       |         ^~~~~~~~~~~~~~
| src/main.c: In function ‘BarMainGetLoginCredentials’:
| src/main.c:142:33: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
|   142 |                                 read (pipeFd[0], passBuf, sizeof (passBuf)-1);
|       |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| make[2]: *** [Makefile:109: src/main.o] Error 1
| In file included from src/main.h:30,
|                  from src/ui_dispatch.h:35,
|                  from src/ui_dispatch.c:26:
| src/player.h:71:9: error: unknown type name ‘AVCodecContext’
|    71 |         AVCodecContext *cctx;
|       |         ^~~~~~~~~~~~~~
| make[2]: *** [Makefile:109: src/ui_dispatch.o] Error 1
| In file included from src/main.h:30,
|                  from src/ui_readline.c:31:
| src/player.h:71:9: error: unknown type name ‘AVCodecContext’
|    71 |         AVCodecContext *cctx;
|       |         ^~~~~~~~~~~~~~
| make[2]: *** [Makefile:109: src/ui_readline.o] Error 1
| In file included from src/ui.h:31,
|                  from src/ui.c:42:
| src/player.h:71:9: error: unknown type name ‘AVCodecContext’
|    71 |         AVCodecContext *cctx;
|       |         ^~~~~~~~~~~~~~
| make[2]: *** [Makefile:109: src/ui.o] Error 1
| src/player.c: In function ‘openStream’:
| src/player.c:238:35: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|   238 |         AVCodec * const decoder = avcodec_find_decoder (cp->codec_id);
|       |                                   ^~~~~~~~~~~~~~~~~~~~
| src/player.c: In function ‘play’:
| src/player.c:407:9: warning: ‘av_init_packet’ is deprecated [-Wdeprecated-declarations]
|   407 |         av_init_packet (&pkt);
|       |         ^~~~~~~~~~~~~~
| In file included from /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:45,
|                  from src/player.c:48:
| /usr/include/x86_64-linux-gnu/libavcodec/packet.h:506:6: note: declared here
|   506 | void av_init_packet(AVPacket *pkt);
|       |      ^~~~~~~~~~~~~~
| make[2]: Leaving directory '/<<PKGBUILDDIR>>'
@PromyLOPh
Copy link
Owner

Downstream issue is at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1004619

I’ll have a look, but it seems the API changed quite a bit unfortunately.

@hobbes1069
Copy link

RPM Fusion just updated to ffmpeg 5.0 and seeing the same error.

@PromyLOPh
Copy link
Owner

Actually, it seems that only an include is missing. Can anyone confirm this patch fixes compilation with ffmpeg 5.0? https://6xq.net/paste/pianobar-ffmpeg-5.0.patch.html

@Unit193
Copy link
Author

Unit193 commented Mar 31, 2022

I can confirm that works for me too.

@PromyLOPh
Copy link
Owner

I applied the patch and created a new release 2022.04.01.

@hobbes1069
Copy link

I went ahead and applied the patch to RPM Fusion and built new packages. Any other reason to update to 2022.04.01?

@PromyLOPh
Copy link
Owner

Nothing major, no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants