Skip to content

Can't build on linux  #1

@AngelJumbo

Description

@AngelJumbo

I have tried to test this project from time to time on my machine, but I keep getting the same result running ninja -C build

ninja: Entering directory `build'
[1/31] Compiling C object mmfm.p/src_media_coder_coder.c.o
FAILED: mmfm.p/src_media_coder_coder.c.o
cc -Immfm.p -I. -I.. -I/usr/include -I/usr/include/GLES2 -I/usr/include/EGL -I/usr/include/SDL2 -I/usr/include/mupdf -I/usr/include/freetype2 -I../src/mt_math -I../src/mt_core -I../src/media_player -I../src/media_coder -I../src/kinetic_ui -I../src/kinetic_ui/egl -I../src/kinetic_ui/handler -I../src/kinetic_ui/texture -I../src/mmfm -I../src/mt_core_ext -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O3 '-DPKG_DATADIR="/usr/local/share/mmfm"' '-DMMFM_VERSION="0.41b"' -Wno-unused-but-set-variable -MD -MQ mmfm.p/src_media_coder_coder.c.o -MF mmfm.p/src_media_coder_coder.c.o.d -o mmfm.p/src_media_coder_coder.c.o -c ../src/media_coder/coder.c
../src/media_coder/coder.c: In function 'coder_load_metadata_into':
../src/media_coder/coder.c:412:44: error: 'AVCodecParameters' has no member named 'ch_layout'; did you mean 'channel_layout'?
  412 |        snprintf(channels, 10, "%i", param->ch_layout.nb_channels);
      |                                            ^~~~~~~~~
      |                                            channel_layout
../src/media_coder/coder.c:431:44: error: 'AVCodecParameters' has no member named 'ch_layout'; did you mean 'channel_layout'?
  431 |        snprintf(channels, 10, "%i", param->ch_layout.nb_channels);
      |                                            ^~~~~~~~~
      |                                            channel_layout
../src/media_coder/coder.c: In function 'coder_write_metadata':
../src/media_coder/coder.c:546:51: warning: passing argument 2 of 'avformat_alloc_output_context2' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  546 |      if (avformat_alloc_output_context2(&enc_ctx, enc_fmt, NULL, new_path) >= 0) // FREE 1
      |                                                   ^~~~~~~
In file included from ../src/media_coder/coder.c:29:
/usr/include/libavformat/avformat.h:2135:86: note: expected 'AVOutputFormat *' but argument is of type 'const AVOutputFormat *'
 2135 | int avformat_alloc_output_context2(AVFormatContext **ctx, ff_const59 AVOutputFormat *oformat,
      |                                                                      ~~~~~~~~~~~~~~~~^~~~~~~
In file included from ../src/media_coder/coder.c:33:
../src/media_coder/coder.c:580:100: error: 'AVCodecParameters' has no member named 'ch_layout'; did you mean 'channel_layout'?
  580 |         case AVMEDIA_TYPE_AUDIO: mt_log_debug("Audio Codec: %d channels, sample rate %d\n", param->ch_layout.nb_channels, param->sample_rate); break;
      |                                                                                                    ^~~~~~~~~
../src/mt_core/mt_log.c:21:68: note: in definition of macro 'mt_log_debug'
   21 | #define mt_log_debug(...) mt_log(MT_LOG_DEBUG, __FILE__, __LINE__, __VA_ARGS__)
      |                                                                    ^~~~~~~~~~~
../src/media_coder/coder.c:641:98: error: 'AVCodecParameters' has no member named 'ch_layout'; did you mean 'channel_layout'?
  641 |       case AVMEDIA_TYPE_AUDIO: mt_log_debug("Audio Codec: %d channels, sample rate %d\n", param->ch_layout.nb_channels, param->sample_rate); break;
      |                                                                                                  ^~~~~~~~~
../src/mt_core/mt_log.c:21:68: note: in definition of macro 'mt_log_debug'
   21 | #define mt_log_debug(...) mt_log(MT_LOG_DEBUG, __FILE__, __LINE__, __VA_ARGS__)
      |                                                                    ^~~~~~~~~~~
[7/31] Compiling C object mmfm.p/src_media_player_decoder.c.o
FAILED: mmfm.p/src_media_player_decoder.c.o
cc -Immfm.p -I. -I.. -I/usr/include -I/usr/include/GLES2 -I/usr/include/EGL -I/usr/include/SDL2 -I/usr/include/mupdf -I/usr/include/freetype2 -I../src/mt_math -I../src/mt_core -I../src/media_player -I../src/media_coder -I../src/kinetic_ui -I../src/kinetic_ui/egl -I../src/kinetic_ui/handler -I../src/kinetic_ui/texture -I../src/mmfm -I../src/mt_core_ext -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O3 '-DPKG_DATADIR="/usr/local/share/mmfm"' '-DMMFM_VERSION="0.41b"' -Wno-unused-but-set-variable -MD -MQ mmfm.p/src_media_player_decoder.c.o -MF mmfm.p/src_media_player_decoder.c.o.d -o mmfm.p/src_media_player_decoder.c.o -c ../src/media_player/decoder.c
In file included from ../src/media_player/decoder.c:6:
../src/media_player/packetqueue.c:17:5: error: unknown type name 'AVFifo'
   17 |     AVFifo*    pkt_list;
      |     ^~~~~~
[8/31] Compiling C object mmfm.p/src_media_player_mediaplayer.c.o
FAILED: mmfm.p/src_media_player_mediaplayer.c.o
cc -Immfm.p -I. -I.. -I/usr/include -I/usr/include/GLES2 -I/usr/include/EGL -I/usr/include/SDL2 -I/usr/include/mupdf -I/usr/include/freetype2 -I../src/mt_math -I../src/mt_core -I../src/media_player -I../src/media_coder -I../src/kinetic_ui -I../src/kinetic_ui/egl -I../src/kinetic_ui/handler -I../src/kinetic_ui/texture -I../src/mmfm -I../src/mt_core_ext -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O3 '-DPKG_DATADIR="/usr/local/share/mmfm"' '-DMMFM_VERSION="0.41b"' -Wno-unused-but-set-variable -MD -MQ mmfm.p/src_media_player_mediaplayer.c.o -MF mmfm.p/src_media_player_mediaplayer.c.o.d -o mmfm.p/src_media_player_mediaplayer.c.o -c ../src/media_player/mediaplayer.c
In file included from ../src/media_player/decoder.c:6,
                 from ../src/media_player/mediaplayer.c:17:
../src/media_player/packetqueue.c:17:5: error: unknown type name 'AVFifo'
   17 |     AVFifo*    pkt_list;
      |     ^~~~~~
../src/media_player/mediaplayer.c:65:5: error: unknown type name 'AVChannelLayout'
   65 |     AVChannelLayout     ch_layout;
      |     ^~~~~~~~~~~~~~~
../src/media_player/mediaplayer.c: In function 'mp_audio_decode_frame':
../src/media_player/mediaplayer.c:491:61: error: 'AVFrame' has no member named 'ch_layout'; did you mean 'channel_layout'?
  491 |     data_size = av_samples_get_buffer_size(NULL, af->frame->ch_layout.nb_channels, af->frame->nb_samples, af->frame->format, 1);
      |                                                             ^~~~~~~~~
      |                                                             channel_layout
../src/media_player/mediaplayer.c:496:2: warning: implicit declaration of function 'av_channel_layout_compare' [-Wimplicit-function-declaration]
  496 |  av_channel_layout_compare(&af->frame->ch_layout, &is->audio_src.ch_layout) ||
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~
../src/media_player/mediaplayer.c:496:40: error: 'AVFrame' has no member named 'ch_layout'; did you mean 'channel_layout'?
  496 |  av_channel_layout_compare(&af->frame->ch_layout, &is->audio_src.ch_layout) ||
      |                                        ^~~~~~~~~
      |                                        channel_layout
../src/media_player/mediaplayer.c:501:2: warning: implicit declaration of function 'swr_alloc_set_opts2'; did you mean 'swr_alloc_set_opts'? [-Wimplicit-function-declaration]
  501 |  swr_alloc_set_opts2(&is->swr_ctx, &is->audio_tgt.ch_layout, is->audio_tgt.fmt, is->audio_tgt.freq, &af->frame->ch_layout, af->frame->format, af->frame->sample_rate, 0, NULL);
      |  ^~~~~~~~~~~~~~~~~~~
      |  swr_alloc_set_opts
../src/media_player/mediaplayer.c:501:113: error: 'AVFrame' has no member named 'ch_layout'; did you mean 'channel_layout'?
  501 |  swr_alloc_set_opts2(&is->swr_ctx, &is->audio_tgt.ch_layout, is->audio_tgt.fmt, is->audio_tgt.freq, &af->frame->ch_layout, af->frame->format, af->frame->sample_rate, 0, NULL);
      |                                                                                                                 ^~~~~~~~~
      |                                                                                                                 channel_layout
../src/media_player/mediaplayer.c:504:216: error: 'AVFrame' has no member named 'ch_layout'; did you mean 'channel_layout'?
  504 |      av_log(NULL, AV_LOG_ERROR, "Cannot create sample rate converter for conversion of %d Hz %s %d channels to %d Hz %s %d channels!\n", af->frame->sample_rate, av_get_sample_fmt_name(af->frame->format), af->frame->ch_layout.nb_channels, is->audio_tgt.freq, av_get_sample_fmt_name(is->audio_tgt.fmt), is->audio_tgt.ch_layout.nb_channels);
      |
                                      ^~~~~~~~~
      |
                                      channel_layout
../src/media_player/mediaplayer.c:504:325: error: request for member 'nb_channels' in something not a structure or union
  504 |      av_log(NULL, AV_LOG_ERROR, "Cannot create sample rate converter for conversion of %d Hz %s %d channels to %d Hz %s %d channels!\n", af->frame->sample_rate, av_get_sample_fmt_name(af->frame->format), af->frame->ch_layout.nb_channels, is->audio_tgt.freq, av_get_sample_fmt_name(is->audio_tgt.fmt), is->audio_tgt.ch_layout.nb_channels);
      |
                                                                                                                                                   ^
../src/media_player/mediaplayer.c:508:6: warning: implicit declaration of function 'av_channel_layout_copy' [-Wimplicit-function-declaration]
  508 |  if (av_channel_layout_copy(&is->audio_src.ch_layout, &af->frame->ch_layout) < 0)
      |      ^~~~~~~~~~~~~~~~~~~~~~
../src/media_player/mediaplayer.c:508:67: error: 'AVFrame' has no member named 'ch_layout'; did you mean 'channel_layout'?
  508 |  if (av_channel_layout_copy(&is->audio_src.ch_layout, &af->frame->ch_layout) < 0)
      |                                                                   ^~~~~~~~~
      |                                                                   channel_layout
../src/media_player/mediaplayer.c:519:86: error: request for member 'nb_channels' in something not a structure or union
  519 |  int             out_size  = av_samples_get_buffer_size(NULL, is->audio_tgt.ch_layout.nb_channels, out_count, is->audio_tgt.fmt, 0);
      |                                                                                      ^
../src/media_player/mediaplayer.c:550:54: error: request for member 'nb_channels' in something not a structure or union
  550 |  resampled_data_size = len2 * is->audio_tgt.ch_layout.nb_channels * av_get_bytes_per_sample(is->audio_tgt.fmt);
      |                                                      ^
../src/media_player/mediaplayer.c: At top level:
../src/media_player/mediaplayer.c:652:33: error: unknown type name 'AVChannelLayout'
  652 | int mp_audio_open(void* opaque, AVChannelLayout* wanted_channel_layout, int wanted_sample_rate, struct AudioParams* audio_hw_params)
      |                                 ^~~~~~~~~~~~~~~
../src/media_player/mediaplayer.c: In function 'mp_stream_open':
../src/media_player/mediaplayer.c:869:5: error: unknown type name 'AVChannelLayout'
  869 |     AVChannelLayout ch_layout   = {0};
      |     ^~~~~~~~~~~~~~~
../src/media_player/mediaplayer.c:871:81: error: 'AVCodecContext' has no member named 'ch_layout'; did you mean 'channel_layout'?
  871 |     ret                         = av_channel_layout_copy(&ch_layout, &codecctx->ch_layout);
      |                                                                                 ^~~~~~~~~
      |                                                                                 channel_layout
../src/media_player/mediaplayer.c:876:15: warning: implicit declaration of function 'mp_audio_open'; did you mean 'avio_open'? [-Wimplicit-function-declaration]
  876 |         ret = mp_audio_open(ms, &ch_layout, sample_rate, &ms->audio_tgt);
      |               ^~~~~~~~~~~~~
      |               avio_open
../src/media_player/mediaplayer.c: In function 'mp_audio_refresh':
../src/media_player/mediaplayer.c:1638:39: error: request for member 'nb_channels' in something not a structure or union
 1638 |     channels = ms->audio_tgt.ch_layout.nb_channels;
      |                                       ^
At top level:
../src/media_player/mediaplayer.c:596:13: warning: 'mp_sdl_audio_callback' defined but not used [-Wunused-function]
  596 | static void mp_sdl_audio_callback(void* opaque, Uint8* stream, int len)
      |             ^~~~~~~~~~~~~~~~~~~~~
[9/31] Compiling C object mmfm.p/src_media_player_packetqueue.c.o
FAILED: mmfm.p/src_media_player_packetqueue.c.o
cc -Immfm.p -I. -I.. -I/usr/include -I/usr/include/GLES2 -I/usr/include/EGL -I/usr/include/SDL2 -I/usr/include/mupdf -I/usr/include/freetype2 -I../src/mt_math -I../src/mt_core -I../src/media_player -I../src/media_coder -I../src/kinetic_ui -I../src/kinetic_ui/egl -I../src/kinetic_ui/handler -I../src/kinetic_ui/texture -I../src/mmfm -I../src/mt_core_ext -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O3 '-DPKG_DATADIR="/usr/local/share/mmfm"' '-DMMFM_VERSION="0.41b"' -Wno-unused-but-set-variable -MD -MQ mmfm.p/src_media_player_packetqueue.c.o -MF mmfm.p/src_media_player_packetqueue.c.o.d -o mmfm.p/src_media_player_packetqueue.c.o -c ../src/media_player/packetqueue.c
../src/media_player/packetqueue.c:17:5: error: unknown type name 'AVFifo'
   17 |     AVFifo*    pkt_list;
      |     ^~~~~~
../src/media_player/packetqueue.c: In function 'packet_queue_init':
../src/media_player/packetqueue.c:46:19: warning: implicit declaration of function 'av_fifo_alloc2'; did you mean 'av_fifo_alloc'? [-Wimplicit-function-declaration]
   46 |     q->pkt_list = av_fifo_alloc2(1, sizeof(MyAVPacketList), AV_FIFO_FLAG_AUTO_GROW);
      |                   ^~~~~~~~~~~~~~
      |                   av_fifo_alloc
../src/media_player/packetqueue.c:46:61: error: 'AV_FIFO_FLAG_AUTO_GROW' undeclared (first use in this function)
   46 |     q->pkt_list = av_fifo_alloc2(1, sizeof(MyAVPacketList), AV_FIFO_FLAG_AUTO_GROW);
      |                                                             ^~~~~~~~~~~~~~~~~~~~~~
../src/media_player/packetqueue.c:46:61: note: each undeclared identifier is reported only once for each function it appears in
../src/media_player/packetqueue.c: In function 'packet_queue_destroy':
../src/media_player/packetqueue.c:68:5: warning: implicit declaration of function 'av_fifo_freep2'; did you mean 'av_fifo_freep'? [-Wimplicit-function-declaration]
   68 |     av_fifo_freep2(&q->pkt_list);
      |     ^~~~~~~~~~~~~~
      |     av_fifo_freep
../src/media_player/packetqueue.c: In function 'packet_queue_flush':
../src/media_player/packetqueue.c:97:12: warning: implicit declaration of function 'av_fifo_read'; did you mean 'av_fifo_reset'? [-Wimplicit-function-declaration]
   97 |     while (av_fifo_read(q->pkt_list, &pkt1, 1) >= 0)
      |            ^~~~~~~~~~~~
      |            av_fifo_reset
../src/media_player/packetqueue.c: In function 'packet_queue_put_private':
../src/media_player/packetqueue.c:117:11: warning: implicit declaration of function 'av_fifo_write'; did you mean 'av_fifo_size'? [-Wimplicit-function-declaration]
  117 |     ret = av_fifo_write(q->pkt_list, &pkt1, 1);
      |           ^~~~~~~~~~~~~
      |           av_fifo_size
[10/31] Compiling C object mmfm.p/src_mmfm_ui.c.o
FAILED: mmfm.p/src_mmfm_ui.c.o
cc -Immfm.p -I. -I.. -I/usr/include -I/usr/include/GLES2 -I/usr/include/EGL -I/usr/include/SDL2 -I/usr/include/mupdf -I/usr/include/freetype2 -I../src/mt_math -I../src/mt_core -I../src/media_player -I../src/media_coder -I../src/kinetic_ui -I../src/kinetic_ui/egl -I../src/kinetic_ui/handler -I../src/kinetic_ui/texture -I../src/mmfm -I../src/mt_core_ext -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -O3 '-DPKG_DATADIR="/usr/local/share/mmfm"' '-DMMFM_VERSION="0.41b"' -Wno-unused-but-set-variable -MD -MQ mmfm.p/src_mmfm_ui.c.o -MF mmfm.p/src_mmfm_ui.c.o.d -o mmfm.p/src_mmfm_ui.c.o -c ../src/mmfm/ui.c
In file included from ../src/media_player/decoder.c:6,
                 from ../src/media_player/mediaplayer.c:17,
                 from ../src/mmfm/ui.c:46:
../src/media_player/packetqueue.c:17:5: error: unknown type name 'AVFifo'
   17 |     AVFifo*    pkt_list;
      |     ^~~~~~
In file included from ../src/mmfm/ui.c:46:
../src/media_player/mediaplayer.c:65:5: error: unknown type name 'AVChannelLayout'
   65 |     AVChannelLayout     ch_layout;
      |     ^~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions