aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2021-08-25 10:37:54 -0300
committerJames Almer <jamrial@gmail.com>2022-03-15 09:42:43 -0300
commit6d8b25841ca47a03abd1cab95be3ec5810bdf84f (patch)
tree8e1ec8b8e0992891429739891e658e64bce0a4ce
parent264e222dbb319b1745597e0ac28124266a18cdd4 (diff)
downloadffmpeg-6d8b25841ca47a03abd1cab95be3ec5810bdf84f.tar.gz
mf: convert to new channel layout API
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/mfenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c
index 410ad64d8d..043026112a 100644
--- a/libavcodec/mfenc.c
+++ b/libavcodec/mfenc.c
@@ -288,7 +288,7 @@ static IMFSample *mf_a_avframe_to_sample(AVCodecContext *avctx, const AVFrame *f
size_t bps;
IMFSample *sample;
- bps = av_get_bytes_per_sample(avctx->sample_fmt) * avctx->channels;
+ bps = av_get_bytes_per_sample(avctx->sample_fmt) * avctx->ch_layout.nb_channels;
len = frame->nb_samples * bps;
sample = ff_create_memory_sample(frame->data[0], len, c->in_info.cbAlignment);
@@ -536,7 +536,7 @@ static int64_t mf_enca_output_score(AVCodecContext *avctx, IMFMediaType *type)
score |= 1LL << 32;
hr = IMFAttributes_GetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, &t);
- if (!FAILED(hr) && t == avctx->channels)
+ if (!FAILED(hr) && t == avctx->ch_layout.nb_channels)
score |= 2LL << 32;
hr = IMFAttributes_GetGUID(type, &MF_MT_SUBTYPE, &tg);
@@ -591,7 +591,7 @@ static int64_t mf_enca_input_score(AVCodecContext *avctx, IMFMediaType *type)
score |= 2;
hr = IMFAttributes_GetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, &t);
- if (!FAILED(hr) && t == avctx->channels)
+ if (!FAILED(hr) && t == avctx->ch_layout.nb_channels)
score |= 4;
return score;
@@ -615,7 +615,7 @@ static int mf_enca_input_adjust(AVCodecContext *avctx, IMFMediaType *type)
}
hr = IMFAttributes_GetUINT32(type, &MF_MT_AUDIO_NUM_CHANNELS, &t);
- if (FAILED(hr) || t != avctx->channels) {
+ if (FAILED(hr) || t != avctx->ch_layout.nb_channels) {
av_log(avctx, AV_LOG_ERROR, "unsupported input channel number set\n");
return AVERROR(EINVAL);
}