avdevice/alsa: simplify passing ff_alsa_open a channel layout

This also ensures the layout set during the indev init is used instead of the
blank one in st->codecpar.

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2025-02-07 23:52:01 -03:00
parent d62fd6e9c8
commit eb3d507b7f
4 changed files with 11 additions and 11 deletions

View file

@ -80,7 +80,7 @@ static av_cold int audio_read_header(AVFormatContext *s1)
}
#endif
ret = ff_alsa_open(s1, SND_PCM_STREAM_CAPTURE, &s->sample_rate, s->ch_layout.nb_channels,
ret = ff_alsa_open(s1, SND_PCM_STREAM_CAPTURE, &s->sample_rate, &s->ch_layout,
&codec_id);
if (ret < 0) {
return AVERROR(EIO);