Skip to content

Commit e1a21e0

Browse files
Fix compatibility with FFmpeg5.0 (#581)
Signed-off-by: bchoi <[email protected]>
1 parent 41a6410 commit e1a21e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

av/src/AudioDecoder.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ bool AudioDecoder::Decode(uint8_t **_outBuffer, unsigned int *_outBufferSize)
157157
// decodedFrame->linesize[0].
158158
int size = decodedFrame->nb_samples *
159159
av_get_bytes_per_sample(this->data->codecCtx->sample_fmt) *
160+
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100)
160161
this->data->codecCtx->ch_layout.nb_channels;
162+
#else
163+
this->data->codecCtx->channels;
164+
#endif
161165
// Resize the audio buffer as necessary
162166
if (*_outBufferSize + size > maxBufferSize)
163167
{

0 commit comments

Comments
 (0)