1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

nutdec: convert to new channel layout API

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Vittorio Giovara
2017-03-31 17:52:39 +02:00
committed by James Almer
parent a1f1f56ef0
commit b9298dad94
2 changed files with 4 additions and 2 deletions

View File

@@ -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))
);

View File

@@ -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);