g722: convert to new channel layout API

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
Anton Khirnov 2013-05-07 07:20:32 +02:00 committed by James Almer
parent 5e257c1f7b
commit c21e1492e3
2 changed files with 7 additions and 2 deletions

View File

@ -59,8 +59,8 @@ static av_cold int g722_decode_init(AVCodecContext * avctx)
{
G722Context *c = avctx->priv_data;
avctx->channels = 1;
avctx->channel_layout = AV_CH_LAYOUT_MONO;
av_channel_layout_uninit(&avctx->ch_layout);
avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
c->band[0].scale_factor = 8;

View File

@ -381,6 +381,11 @@ const AVCodec ff_adpcm_g722_encoder = {
.close = g722_encode_close,
.encode2 = g722_encode_frame,
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE },
#if FF_API_OLD_CHANNEL_LAYOUT
.channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 },
#endif
.ch_layouts = (const AVChannelLayout[]){
AV_CHANNEL_LAYOUT_MONO, { 0 }
},
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};