aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2017-03-31 17:52:39 +0200
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:35 -0300
commitb9298dad940db1ac49658039a99f9308f57019c0 (patch)
tree0e32b9e8344c0630af90777efed9f55e9426fa7f /libavformat
parenta1f1f56ef072e84f1708adffe5185edb58ac2a89 (diff)
downloadffmpeg-b9298dad940db1ac49658039a99f9308f57019c0.tar.gz
nutdec: 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')
-rw-r--r--libavformat/nutdec.c4
-rw-r--r--libavformat/nutenc.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index f9ad2c0af1..6611fbc1d7 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -457,7 +457,7 @@ static int decode_stream_header(NUTContext *nut)
} else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
GET_V(st->codecpar->sample_rate, tmp > 0);
ffio_read_varlen(bc); // samplerate_den
- GET_V(st->codecpar->channels, tmp > 0);
+ GET_V(st->codecpar->ch_layout.nb_channels, tmp > 0);
}
if (skip_reserved(bc, end) || ffio_get_checksum(bc)) {
av_log(s, AV_LOG_ERROR,
@@ -961,8 +961,10 @@ static int read_sm_data(AVFormatContext *s, AVIOContext *bc, AVPacket *pkt, int
if (!dst)
return AVERROR(ENOMEM);
bytestream_put_le32(&dst,
+#if FF_API_OLD_CHANNEL_LAYOUT
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT*(!!channels) +
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT*(!!channel_layout) +
+#endif
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE*(!!sample_rate) +
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS*(!!(width|height))
);
diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c
index 9d5eb4ed99..f88b424429 100644
--- a/libavformat/nutenc.c
+++ b/libavformat/nutenc.c
@@ -461,7 +461,7 @@ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc,
case AVMEDIA_TYPE_AUDIO:
put_v(bc, par->sample_rate);
put_v(bc, 1);
- put_v(bc, par->channels);
+ put_v(bc, par->ch_layout.nb_channels);
break;
case AVMEDIA_TYPE_VIDEO:
put_v(bc, par->width);