summaryrefslogtreecommitdiff
path: root/libavformat/bink.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 13:37:38 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:30 -0300
commitf508915777a5246290c06d47a115581bfbe05fee (patch)
treeb5aa14878b22feaf2142d81835998af3ae186b96 /libavformat/bink.c
parentd76c72643b3ca833ebfcb3c5c845b4b76d58ff4f (diff)
bink: convert to new channel layout API
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/bink.c')
-rw-r--r--libavformat/bink.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/bink.c b/libavformat/bink.c
index 6627a17e71..4f413bd986 100644
--- a/libavformat/bink.c
+++ b/libavformat/bink.c
@@ -186,11 +186,9 @@ static int read_header(AVFormatContext *s)
ast->codecpar->codec_id = flags & BINK_AUD_USEDCT ?
AV_CODEC_ID_BINKAUDIO_DCT : AV_CODEC_ID_BINKAUDIO_RDFT;
if (flags & BINK_AUD_STEREO) {
- ast->codecpar->channels = 2;
- ast->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
+ ast->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
} else {
- ast->codecpar->channels = 1;
- ast->codecpar->channel_layout = AV_CH_LAYOUT_MONO;
+ ast->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
}
if ((ret = ff_alloc_extradata(ast->codecpar, 4)) < 0)
return ret;
@@ -283,7 +281,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
(in bytes). We use this value to calculate the audio PTS */
if (pkt->size >= 4)
bink->audio_pts[bink->current_track -1] +=
- AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codecpar->channels);
+ AV_RL32(pkt->data) / (2 * s->streams[bink->current_track]->codecpar->ch_layout.nb_channels);
return 0;
} else {
avio_skip(pb, audio_size);