diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-17 06:00:16 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-17 19:13:40 +0200 |
commit | f60c3ca1361921ff7929a4dc14ed874f22f37f98 (patch) | |
tree | dc42e577916445e0ba85d8759b817098b98d14fb /libavfilter | |
parent | 1aa640c7d785c39e0e19407521132d77b594e654 (diff) | |
download | ffmpeg-f60c3ca1361921ff7929a4dc14ed874f22f37f98.tar.gz |
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>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/audio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/audio.c b/libavfilter/audio.c index 5289b94067..cebc9709dd 100644 --- a/libavfilter/audio.c +++ b/libavfilter/audio.c @@ -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, |