diff --git a/libavdevice/sndio_dec.c b/libavdevice/sndio_dec.c index ec8fa4126a..6059830367 100644 --- a/libavdevice/sndio_dec.c +++ b/libavdevice/sndio_dec.c @@ -49,7 +49,7 @@ static av_cold int audio_read_header(AVFormatContext *s1) st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = s->codec_id; st->codecpar->sample_rate = s->sample_rate; - st->codecpar->channels = s->channels; + st->codecpar->ch_layout.nb_channels = s->channels; avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */ diff --git a/libavdevice/sndio_enc.c b/libavdevice/sndio_enc.c index 2e698d7c35..a595438d8a 100644 --- a/libavdevice/sndio_enc.c +++ b/libavdevice/sndio_enc.c @@ -36,7 +36,7 @@ static av_cold int audio_write_header(AVFormatContext *s1) st = s1->streams[0]; s->sample_rate = st->codecpar->sample_rate; - s->channels = st->codecpar->channels; + s->channels = st->codecpar->ch_layout.nb_channels; ret = ff_sndio_open(s1, 1, s1->url);