avfilter/audio: Don't call av_get_channel_layout_nb_channels twice

Also makes the assert-string shorter.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-08-17 06:00:16 +02:00
parent 1aa640c7d7
commit f60c3ca136
1 changed files with 2 additions and 1 deletions

View File

@ -40,8 +40,9 @@ AVFrame *ff_default_get_audio_buffer(AVFilterLink *link, int nb_samples)
{
AVFrame *frame = NULL;
int channels = link->channels;
int channel_layout_nb_channels = av_get_channel_layout_nb_channels(link->channel_layout);
av_assert0(channels == av_get_channel_layout_nb_channels(link->channel_layout) || !av_get_channel_layout_nb_channels(link->channel_layout));
av_assert0(channels == channel_layout_nb_channels || !channel_layout_nb_channels);
if (!link->frame_pool) {
link->frame_pool = ff_frame_pool_audio_init(av_buffer_allocz, channels,