mickelson / attract

A graphical front-end for command line emulators that hides the underlying operating system and is intended to be controlled with a joystick or gamepad.
http://attractmode.org
GNU General Public License v3.0
393 stars 113 forks source link

Add compatibility with FFMPEG 7.0 #756

Closed eclipseo closed 3 weeks ago

eclipseo commented 2 months ago

FFMPEG 7 removed the deprecated channels inf favor of ch_layout.

This has not been tested beside building.

mickelson commented 2 months ago

Hi there, thanks for this!

I'm getting the following error when I try to compile your PR:

$ make -j8
flags: -std=c++11  -Wl,--export-dynamic -I/usr/include/freetype2 -I/usr/include/libpng16 -DDATA_PATH=\"/usr/local/share/attract/\" -O2 -DNDEBUG -Iextlibs/audio/include -D__STDC_CONSTANT_MACROS -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu -I/usr/include/AL -Iextlibs/squirrel/include -Iextlibs/sqrat/include -Iextlibs/nowide -Iextlibs/nvapi -Iextlibs/rapidjson/include -Iextlibs/gameswf -DUSE_XLIB -DUSE_XINERAMA -DFE_HWACCEL_VDPAU -DUSE_FONTCONFIG -DUSE_LIBARCHIVE -DUSE_LIBCURL
Compiling obj/media.o...
src/media.cpp: In member function ‘void FeVideoImp::video_thread()’:
src/media.cpp:788:76: error: ‘AVFrame’ {aka ‘struct AVFrame’} has no member named ‘duration’; did you mean ‘pkt_duration’?
  788 |                                    prev_duration = raw_frame->duration;
      |                                                               ^~~~~~~~
      |                                                               pkt_duration
make: *** [Makefile:507: obj/media.o] Error 1

My FFmpeg versions are: avcodec 58.134.100 / avformat 58.76.100 / swscale 5.9.100 / avutil 56.70.100 / swresample 3.9.100

eclipseo commented 2 months ago

Added:

define HAVE_DURATION (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(58, 2, 100))

mickelson commented 3 weeks ago

works for me! thanks!