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

error: no member named 'channels' in 'AVCodecContext' #1540

Closed
aviumcaravan opened this issue Aug 28, 2024 · 2 comments
Closed

error: no member named 'channels' in 'AVCodecContext' #1540

aviumcaravan opened this issue Aug 28, 2024 · 2 comments

Comments

@aviumcaravan
Copy link

Build Log
What is the build error?

/home/kluska/Sources/darling/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:103:8: error: no member named 'channels' in 'AVCodecContext'
  103 |                 cIn->channels = inSourceFormat->mChannelsPerFrame;
      |                 ~~~  ^
/home/kluska/Sources/darling/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:106:52: error: no member named 'channels' in 'AVCodecContext'
  106 |                 std::cout << "Converting from PCM with " << cIn->channels << " channels at " << cIn->sample_rate << " Hz\n";
      |                                                             ~~~  ^
/home/kluska/Sources/darling/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:134:13: error: no member named 'channels' in 'AVCodecContext'
  134 |         m_encoder->channels = m_destinationFormat.mChannelsPerFrame;
      |         ~~~~~~~~~  ^
/home/kluska/Sources/darling/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:136:13: error: no member named 'channel_layout' in 'AVCodecContext'
  136 |         m_encoder->channel_layout = CAChannelCountToLayout(m_destinationFormat.mChannelsPerFrame);
      |         ~~~~~~~~~  ^
/home/kluska/Sources/darling/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:164:16: error: no member named 'channel_layout' in 'AVFrame'
  164 |         m_audioFrame->channel_layout = m_encoder->channel_layout;
      |         ~~~~~~~~~~~~  ^
/home/kluska/Sources/darling/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:164:44: error: no member named 'channel_layout' in 'AVCodecContext'
  164 |         m_audioFrame->channel_layout = m_encoder->channel_layout;
      |                                        ~~~~~~~~~  ^
/home/kluska/Sources/darling/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:167:78: error: no member named 'channels' in 'AVCodecContext'
  167 |         int audioSampleBuffer_size = av_samples_get_buffer_size(nullptr, m_encoder->channels, m_audioFrame->nb_samples, m_encoder->sample_fmt, 0);
      |                                                                          ~~~~~~~~~  ^
/home/kluska/Sources/darling/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:177:66: error: no member named 'channels' in 'AVCodecContext'
  177 |         if (int err = avcodec_fill_audio_frame(m_audioFrame, m_encoder->channels, m_encoder->sample_fmt,
      |                                                              ~~~~~~~~~  ^
/home/kluska/Sources/darling/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:456:4: warning: TODO: test this new avcodec decoder code [-W#warnings]
  456 |                 #warning TODO: test this new avcodec decoder code
      |                  ^
/home/kluska/Sources/darling/src/CoreAudio/AudioToolbox/AudioConverterImpl.cpp:570:5: warning: TODO: test this new avcodec encoder code [-W#warnings]
  570 |                         #warning TODO: test this new avcodec encoder code
      |                          ^
4 warnings and 8 errors generated.

this is a known incompatibility between previous versions of FFmpeg and FFmpeg 7.

System Information
Arch Linux AMD64, last updated on August 27th, 2024

Software Version
Clang 18.1.8
CMake 3.30.2
Linux Kernel 6.10.5-arch1-1
Darling 773e987
@CuriousTommy
Copy link
Contributor

Related to #1525, but I'll leave this issue open.

I created a fix for it, but haven't merge it in yet: #1537

@CuriousTommy
Copy link
Contributor

Changes are merged

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

No branches or pull requests

2 participants