diff --git a/libavformat/pcm.c b/libavformat/pcm.c index e91117ce5a..9741f73667 100644 --- a/libavformat/pcm.c +++ b/libavformat/pcm.c @@ -63,7 +63,7 @@ int ff_pcm_read_seek(AVFormatContext *s, st = s->streams[0]; block_align = st->codecpar->block_align ? st->codecpar->block_align : - (av_get_bits_per_sample(st->codecpar->codec_id) * st->codecpar->channels) >> 3; + (av_get_bits_per_sample(st->codecpar->codec_id) * st->codecpar->ch_layout.nb_channels) >> 3; byte_rate = st->codecpar->bit_rate ? st->codecpar->bit_rate >> 3 : block_align * st->codecpar->sample_rate; diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c index 63539a47c0..24e9591454 100644 --- a/libavformat/pcmdec.c +++ b/libavformat/pcmdec.c @@ -48,7 +48,7 @@ static int pcm_read_header(AVFormatContext *s) par->codec_type = AVMEDIA_TYPE_AUDIO; par->codec_id = s->iformat->raw_codec_id; par->sample_rate = s1->sample_rate; - par->channels = s1->channels; + par->ch_layout.nb_channels = s1->channels; av_opt_get(s->pb, "mime_type", AV_OPT_SEARCH_CHILDREN, &mime_type); if (mime_type && s->iformat->mime_type) { @@ -77,7 +77,7 @@ static int pcm_read_header(AVFormatContext *s) } par->sample_rate = rate; if (channels > 0) - par->channels = channels; + par->ch_layout.nb_channels = channels; if (little_endian) par->codec_id = AV_CODEC_ID_PCM_S16LE; } @@ -88,7 +88,7 @@ static int pcm_read_header(AVFormatContext *s) av_assert0(par->bits_per_coded_sample > 0); - par->block_align = par->bits_per_coded_sample * par->channels / 8; + par->block_align = par->bits_per_coded_sample * par->ch_layout.nb_channels / 8; avpriv_set_pts_info(st, 64, 1, par->sample_rate); return 0;