diff options
author | Slávek Banko <[email protected]> | 2024-08-09 16:37:15 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2024-08-11 09:43:49 +0200 |
commit | 75435ce16e979957fa6e5d43bbd3cbe19ca289cc (patch) | |
tree | 62d24d1d36cfc82b6ba8512041ecf7cc8f00c0fb | |
parent | fb26314abd54e459a41d8cfd471288139f927ca4 (diff) | |
download | k3b-75435ce16e979957fa6e5d43bbd3cbe19ca289cc.tar.gz k3b-75435ce16e979957fa6e5d43bbd3cbe19ca289cc.zip |
Fix compatibility with ffmpeg 7.x.r14.1.3
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit 4f37ec7d7b0a266c3412a919799ff7f2a0c7b48d)
-rw-r--r-- | plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp index 983c808..3e34c5c 100644 --- a/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp +++ b/plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp @@ -217,8 +217,13 @@ bool K3bFFMpegFile::open() { #else d->sampleFormat = static_cast<::AVSampleFormat>(d->audio_stream->codecpar->format); #endif +# if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 24, 100) d->isSpacious = ::av_sample_fmt_is_planar(d->sampleFormat) && d->audio_stream->codecpar->channels > 1; +# else + d->isSpacious = ::av_sample_fmt_is_planar(d->sampleFormat) && + d->audio_stream->codecpar->ch_layout.nb_channels > 1; +# endif // dump some debugging info ::av_dump_format(d->formatContext, 0, m_filename.local8Bit(), 0); @@ -255,7 +260,11 @@ int K3bFFMpegFile::sampleRate() const { } int K3bFFMpegFile::channels() const { +# if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 24, 100) return d->audio_stream->codecpar->channels; +# else + return d->audio_stream->codecpar->ch_layout.nb_channels; +# endif } int K3bFFMpegFile::type() const { return d->audio_stream->codecpar->codec_id; } |