PromyLOPh / pianobar

Console-based pandora.com player
http://6xq.net/pianobar/
Other
1.73k stars 323 forks source link

Fails to build with ffmpeg 5.0 #730

Closed Unit193 closed 2 years ago

Unit193 commented 2 years ago

Subject of the issue

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

Your environment

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 commented 2 years ago

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 commented 2 years ago

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

PromyLOPh commented 2 years ago

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 commented 2 years ago

I can confirm that works for me too.

PromyLOPh commented 2 years ago

I applied the patch and created a new release 2022.04.01.

hobbes1069 commented 2 years ago

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

PromyLOPh commented 2 years ago

Nothing major, no.