diff options
author | Artem Dyomin <artem.dyomin@qt.io> | 2024-01-24 11:59:50 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-01-24 11:56:58 +0000 |
commit | ead22a2ad8e458ec34514e23b291aab5146c9f95 (patch) | |
tree | 6c8877914171ba5b4aff45316b44ad319d197b3d /src/plugins/multimedia/ffmpeg/qffmpeg.cpp | |
parent | 56c37105e39303aeb1a27418b80be0953f9b08ea (diff) |
Fix build with ffmpeg swrresample version < 4.9.100v6.7.0-beta2
swr_alloc_set_opts2 takes 'const AVChannelLayout*' from
LIBSWRESAMPLE_VERSION 4.9.100
Fixes: QTBUG-121455
Pick-to: 6.6 6.5
Change-Id: I06812f9efedd53e12152fb3cf1574ad8c7c61d27
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
(cherry picked from commit b0cffad4411a0c8d6469a892bcf98cf4384ae6f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/plugins/multimedia/ffmpeg/qffmpeg.cpp')
-rw-r--r-- | src/plugins/multimedia/ffmpeg/qffmpeg.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/multimedia/ffmpeg/qffmpeg.cpp b/src/plugins/multimedia/ffmpeg/qffmpeg.cpp index f5b97566a..d7095edee 100644 --- a/src/plugins/multimedia/ffmpeg/qffmpeg.cpp +++ b/src/plugins/multimedia/ffmpeg/qffmpeg.cpp @@ -479,11 +479,18 @@ SwrContextUPtr createResampleContext(const ResampleAudioFormat& inputFormat, 0, nullptr); #else + +#if QT_FFMPEG_SWR_CONST_CH_LAYOUT + using AVChannelLayoutPrm = const AVChannelLayout*; +#else + using AVChannelLayoutPrm = AVChannelLayout*; +#endif + swr_alloc_set_opts2(&resampler, - &outputFormat.channelLayout, + const_cast<AVChannelLayoutPrm>(&outputFormat.channelLayout), outputFormat.sampleFormat, outputFormat.sampleRate, - &inputFormat.channelLayout, + const_cast<AVChannelLayoutPrm>(&inputFormat.channelLayout), inputFormat.sampleFormat, inputFormat.sampleRate, 0, |