nunuhara / xsystem4

Cross-platform implementation of AliceSoft's System 4 engine
GNU General Public License v2.0
46 stars 4 forks source link

Compiling src/xsystem4.p/movie_ffmpeg.c.o fails #159

Closed hachinichi closed 5 months ago

hachinichi commented 5 months ago

A little while ago, I compiled the program from source on Arch Linux perfectly fine and had been playing through Sengoku Rance. Today, I made a new Arch install on my same system, and after installing all of the dependencies, I tried to compile xsystem4 from source again using the readme's instructions. This time, however, it's been getting stuck at the following error when using ninja to build the executable:

ninja: Entering directory `build'
[221/223] Compiling C object src/xsystem4.p/movie_ffmpeg.c.o
FAILED: src/xsystem4.p/movie_ffmpeg.c.o 
cc -Isrc/xsystem4.p -Isrc -I../src -I../include -I../subprojects/cglm/include -I../subprojects/libsys4/include -I/usr/include/SDL2 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/opus -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c11 -O0 -g '-DXSYS4_DATA_DIR="/usr/local/share/xsystem4"' -DUSE_GLES -DDEBUGGER_ENABLED -DHAVE_SCHEME -DHAVE_READLINE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -pthread -D_REENTRANT -Wno-unused-parameter -MD -MQ src/xsystem4.p/movie_ffmpeg.c.o -MF src/xsystem4.p/movie_ffmpeg.c.o.d -o src/xsystem4.p/movie_ffmpeg.c.o -c ../src/movie_ffmpeg.c
../src/movie_ffmpeg.c:44:9: error: unknown type name ‘AVFifoBuffer’; did you mean ‘AVBuffer’?
   44 |         AVFifoBuffer *queue;
      |         ^~~~~~~~~~~~
      |         AVBuffer
../src/movie_ffmpeg.c: In function ‘free_decoder’:
../src/movie_ffmpeg.c:82:24: error: implicit declaration of function ‘av_fifo_size’; did you mean ‘av_fifo_write’? [-Wimplicit-function-declaration]
   82 |                 while (av_fifo_size(dec->queue) > 0) {
      |                        ^~~~~~~~~~~~
      |                        av_fifo_write
../src/movie_ffmpeg.c:84:25: error: implicit declaration of function ‘av_fifo_generic_read’; did you mean ‘av_fifo_can_read’? [-Wimplicit-function-declaration]
   84 |                         av_fifo_generic_read(dec->queue, &packet, sizeof(AVPacket*), NULL);
      |                         ^~~~~~~~~~~~~~~~~~~~
      |                         av_fifo_can_read
../src/movie_ffmpeg.c:87:17: error: implicit declaration of function ‘av_fifo_freep’; did you mean ‘av_fifo_freep2’? [-Wimplicit-function-declaration]
   87 |                 av_fifo_freep(&dec->queue);
      |                 ^~~~~~~~~~~~~
      |                 av_fifo_freep2
../src/movie_ffmpeg.c: In function ‘init_decoder’:
../src/movie_ffmpeg.c:105:22: error: implicit declaration of function ‘av_fifo_alloc’; did you mean ‘av_fifo_alloc2’? [-Wimplicit-function-declaration]
  105 |         dec->queue = av_fifo_alloc(sizeof(AVPacket*) * QUEUE_SIZE);
      |                      ^~~~~~~~~~~~~
      |                      av_fifo_alloc2
../src/movie_ffmpeg.c:105:20: error: assignment to ‘int *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  105 |         dec->queue = av_fifo_alloc(sizeof(AVPacket*) * QUEUE_SIZE);
      |                    ^
../src/movie_ffmpeg.c: In function ‘read_packet’:
../src/movie_ffmpeg.c:118:29: error: implicit declaration of function ‘av_fifo_space’; did you mean ‘av_fifo_peek’? [-Wimplicit-function-declaration]
  118 |                         if (av_fifo_space(mc->video.queue) < (int)sizeof(AVPacket*))
      |                             ^~~~~~~~~~~~~
      |                             av_fifo_peek
../src/movie_ffmpeg.c:119:33: error: implicit declaration of function ‘av_fifo_grow’; did you mean ‘av_fifo_grow2’? [-Wimplicit-function-declaration]
  119 |                                 av_fifo_grow(mc->video.queue, sizeof(AVPacket*) * QUEUE_SIZE);
      |                                 ^~~~~~~~~~~~
      |                                 av_fifo_grow2
../src/movie_ffmpeg.c:120:25: error: implicit declaration of function ‘av_fifo_generic_write’; did you mean ‘av_fifo_can_write’? [-Wimplicit-function-declaration]
  120 |                         av_fifo_generic_write(mc->video.queue, &packet, sizeof(AVPacket *), NULL);
      |                         ^~~~~~~~~~~~~~~~~~~~~
      |                         av_fifo_can_write
../src/movie_ffmpeg.c: In function ‘audio_callback’:
Alicesoft really dropped Rance Quest (vanilla) and DTK at around the same time
[3:21 PM]
I know Japanese fans were malding
../src/movie_ffmpeg.c:190:57: error: ‘AVCodecContext’ has no member named ‘channels’
  190 |         uint8_t *r = mc->audio.frame->data[mc->audio.ctx->channels > 1 ? 1 : 0];
      |                                                         ^~
In file included from ../src/movie_ffmpeg.c:29:
../src/movie_ffmpeg.c: In function ‘movie_load’:
../src/movie_ffmpeg.c:257:90: error: ‘AVCodecContext’ has no member named ‘channels’
  257 |         NOTICE("audio: %d hz, %d channels, %s", mc->audio.ctx->sample_rate, mc->audio.ctx->channels, av_get_sample_fmt_name(mc->audio.ctx->sample_fmt));
      |                                                                                          ^~
../subprojects/libsys4/include/system4.h:44:33: note: in definition of macro ‘NOTICE’
   44 |         sys_message(fmt "\n", ##__VA_ARGS__)
      |                                 ^~~~~~~~~~~
[222/223] Compiling C object src/xsystem4.p/debugger_dap.c.o
ninja: build stopped: subcommand failed.

I've made sure to install/reinstall both ffmpeg and ffmpeg4 to see if that'd work, but it still gets the same error. Might have something to do with a newer ffmpeg version I have installed? Not sure, though.

kichikuou commented 5 months ago

https://github.com/nunuhara/xsystem4/pull/160 should fix this.