Skip to content

Commit

Permalink
485432: Add libavcodec version major check for FFmpeg avutil: remove …
Browse files Browse the repository at this point in the history
…deprecated FF_API_OLD_CHANNEL_LAYOUT
  • Loading branch information
xiangzhai committed Apr 13, 2024
1 parent e4d346c commit 712ef4a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugins/decoder/ffmpeg/k3bffmpegwrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,13 @@ bool K3bFFMpegFile::open()
}

d->sampleFormat = d->codecContext->sample_fmt;
#if LIBAVCODEC_VERSION_MAJOR < 70
d->isSpacious = ::av_sample_fmt_is_planar(d->sampleFormat) &&
d->codecContext->channels > 1;
#else
#pragma Unimplemented
d->isSpacious = ::av_sample_fmt_is_planar(d->sampleFormat);
#endif
d->packet = ::av_packet_alloc();

// dump some debugging info
Expand Down Expand Up @@ -185,7 +190,12 @@ int K3bFFMpegFile::sampleRate() const

int K3bFFMpegFile::channels() const
{
#if LIBAVCODEC_VERSION_MAJOR < 70
return d->codecContext->channels;
#else
#pragma Unimplemented
return 0;
#endif
}


Expand Down

0 comments on commit 712ef4a

Please sign in to comment.