sdrangel
sdrangel copied to clipboard
Fix CI for Mac OS
This PR tries to work around missing a build failure in the CI for Mac:
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:282:46: error: no member named 'channels' in 'AVCodecContext'
m_metaData.Channels = m_videoDecoderCtx->channels;
~~~~~~~~~~~~~~~~~ ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:308:48: error: no member named 'channels' in 'AVCodecContext'
<< " channels: " << m_audioDecoderCtx->channels
~~~~~~~~~~~~~~~~~ ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:309:54: error: no member named 'channel_layout' in 'AVCodecContext'
<< " channel_layout: " << m_audioDecoderCtx->channel_layout
~~~~~~~~~~~~~~~~~ ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:628:72: error: no member named 'channels' in 'AVCodecContext'
av_opt_set_int(m_audioSWR, "in_channel_count", m_audioDecoderCtx->channels, 0);
~~~~~~~~~~~~~~~~~ ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:630:73: error: no member named 'channel_layout' in 'AVCodecContext'
av_opt_set_int(m_audioSWR, "in_channel_layout", m_audioDecoderCtx->channel_layout, 0);
~~~~~~~~~~~~~~~~~ ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:640:57: error: no member named 'channels' in 'AVCodecContext'
<< " in_channel_count: " << m_audioDecoderCtx->channels
~~~~~~~~~~~~~~~~~ ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:642:58: error: no member named 'channel_layout' in 'AVCodecContext'
<< " in_channel_layout: " << m_audioDecoderCtx->channel_layout
~~~~~~~~~~~~~~~~~ ^
7 errors generated.```
An alternative that could be tested is disabling the plugins that use libavcodec
-DENABLE_CHANNELRX_DEMODDATV=OFF
-DENABLE_CHANNELTX_MODDATV=OFF
The problem needs to be fixed, not hidden. The point of this build is to identify problems.
Presumably something has changed in the latest ffmpeg.
Yeah - ffmpeg API has changed, so this code needs to be updated to work with more recent versions.
I've searched around and it seems the following are replacements: channels -> ch_layout.nb_channels channel_layout -> ch_layout.u.mask Ref: https://github.com/HandBrake/HandBrake/pull/4451/commits/5e86b74d405f63ed020fa09eb076a65b7337bd4e
However FFMPEG v5 and < v5 are incompatible.
I think Ubuntu 24.04 to be released very soon is shipped with ffmpeg v6 so maybe we could wait a little bit. But we will have to upgrade for Windows too.
Apparently one may also define FF_API_OLD_CHANNEL_LAYOUT