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>
pull/364/head
Andreas Rheinhardt 3 years ago
parent 1aa640c7d7
commit f60c3ca136
  1. 3
      libavfilter/audio.c

@ -40,8 +40,9 @@ AVFrame *ff_default_get_audio_buffer(AVFilterLink *link, int nb_samples)
{ {
AVFrame *frame = NULL; AVFrame *frame = NULL;
int channels = link->channels; 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) { if (!link->frame_pool) {
link->frame_pool = ff_frame_pool_audio_init(av_buffer_allocz, channels, link->frame_pool = ff_frame_pool_audio_init(av_buffer_allocz, channels,

Loading…
Cancel
Save