diff options
author | Anton Khirnov <anton@khirnov.net> | 2019-05-13 11:11:26 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-03-15 09:42:29 -0300 |
commit | b49e80a6498431b11fc14f5b00bd36c23351e92b (patch) | |
tree | a4dfe8b2547986ad583a60f4a15d8ca30343ba03 | |
parent | ac10e3c47cc2d252822ff5ca70fce2ef40df4277 (diff) | |
download | ffmpeg-b49e80a6498431b11fc14f5b00bd36c23351e92b.tar.gz |
3dostr: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavformat/3dostr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/3dostr.c b/libavformat/3dostr.c index 0c136c9ea0..fea12d03e6 100644 --- a/libavformat/3dostr.c +++ b/libavformat/3dostr.c @@ -102,15 +102,15 @@ static int threedostr_read_header(AVFormatContext *s) st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->sample_rate = avio_rb32(s->pb); - st->codecpar->channels = avio_rb32(s->pb); - if (st->codecpar->channels <= 0 || st->codecpar->sample_rate <= 0) + st->codecpar->ch_layout.nb_channels = avio_rb32(s->pb); + if (st->codecpar->ch_layout.nb_channels <= 0 || st->codecpar->sample_rate <= 0) return AVERROR_INVALIDDATA; codec = avio_rl32(s->pb); avio_skip(s->pb, 4); if (ctrl_size == 20 || ctrl_size == 3 || ctrl_size == -1) - st->duration = (avio_rb32(s->pb) - 1) / st->codecpar->channels; + st->duration = (avio_rb32(s->pb) - 1) / st->codecpar->ch_layout.nb_channels; else - st->duration = avio_rb32(s->pb) * 16 / st->codecpar->channels; + st->duration = avio_rb32(s->pb) * 16 / st->codecpar->ch_layout.nb_channels; size -= 56; found_shdr = 1; break; @@ -135,7 +135,7 @@ static int threedostr_read_header(AVFormatContext *s) switch (codec) { case MKTAG('S','D','X','2'): st->codecpar->codec_id = AV_CODEC_ID_SDX2_DPCM; - st->codecpar->block_align = 1 * st->codecpar->channels; + st->codecpar->block_align = 1 * st->codecpar->ch_layout.nb_channels; break; default: avpriv_request_sample(s, "codec %X", codec); @@ -178,7 +178,7 @@ static int threedostr_read_packet(AVFormatContext *s, AVPacket *pkt) ret = av_get_packet(s->pb, pkt, size); pkt->pos = pos; pkt->stream_index = 0; - pkt->duration = size / st->codecpar->channels; + pkt->duration = size / st->codecpar->ch_layout.nb_channels; return ret; default: av_log(s, AV_LOG_DEBUG, "skipping unknown chunk: %X\n", chunk); |