[FFmpeg-cvslog] avfilter/audio: Don't call av_get_channel_layout_nb_channels twice
Andreas Rheinhardt
git at videolan.org
Tue Aug 17 20:50:09 EEST 2021
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Aug 17 06:00:16 2021 +0200| [f60c3ca1361921ff7929a4dc14ed874f22f37f98] | committer: Andreas Rheinhardt
avfilter/audio: Don't call av_get_channel_layout_nb_channels twice
Also makes the assert-string shorter.
Reviewed-by: Nicolas George <george at nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f60c3ca1361921ff7929a4dc14ed874f22f37f98
---
libavfilter/audio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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,
More information about the ffmpeg-cvslog
mailing list