It is the same as avfilter_get_audio_buffer_ref_from_arrays except it has a "channels" and the channel layout can be 0.
Showing the changes to libavfilter/src_buffer.c (1 of 4 files). Show all
Unified · Split
| @@ -81,6 +81,8 @@ int av_asrc_buffer_add_samples(AVFilterContext *ctx, · 80 unmodified lines | ||
| 81 | 81 | { |
| 82 | 82 | AVFilterBufferRef *samplesref; |
| 83 | 83 | |
| 84 | + if (!channel_layout) | |
| 85 | + return AVERROR(EINVAL); | |
| 84 | 86 | samplesref = avfilter_get_audio_buffer_ref_from_arrays( |
| 85 | 87 | data, linesize[0], AV_PERM_WRITE, |
| 86 | 88 | nb_samples, |