Commit f60c3ca1 authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avfilter/audio: Don't call av_get_channel_layout_nb_channels twice

Also makes the assert-string shorter.
Reviewed-by: 's avatarNicolas George <george@nsup.org>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
parent 1aa640c7
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment