Skip to content

Commit

Permalink
Fix compatibility with FFmpeg5.0 (#581)
Browse files Browse the repository at this point in the history
Signed-off-by: bchoi <[email protected]>
  • Loading branch information
bchoineubility authored Mar 11, 2024
1 parent 41a6410 commit e1a21e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions av/src/AudioDecoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ bool AudioDecoder::Decode(uint8_t **_outBuffer, unsigned int *_outBufferSize)
// decodedFrame->linesize[0].
int size = decodedFrame->nb_samples *
av_get_bytes_per_sample(this->data->codecCtx->sample_fmt) *
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100)
this->data->codecCtx->ch_layout.nb_channels;
#else
this->data->codecCtx->channels;
#endif
// Resize the audio buffer as necessary
if (*_outBufferSize + size > maxBufferSize)
{
Expand Down

0 comments on commit e1a21e0

Please sign in to comment.