ra144: 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:
committed by
James Almer
parent
063e5f1fa9
commit
513c0e276f
@@ -39,8 +39,8 @@ static av_cold int ra144_decode_init(AVCodecContext * avctx)
|
|||||||
ractx->lpc_coef[0] = ractx->lpc_tables[0];
|
ractx->lpc_coef[0] = ractx->lpc_tables[0];
|
||||||
ractx->lpc_coef[1] = ractx->lpc_tables[1];
|
ractx->lpc_coef[1] = ractx->lpc_tables[1];
|
||||||
|
|
||||||
avctx->channels = 1;
|
av_channel_layout_uninit(&avctx->ch_layout);
|
||||||
avctx->channel_layout = AV_CH_LAYOUT_MONO;
|
avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
|
||||||
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
|
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -51,11 +51,6 @@ static av_cold int ra144_encode_init(AVCodecContext * avctx)
|
|||||||
RA144Context *ractx;
|
RA144Context *ractx;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (avctx->channels != 1) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n",
|
|
||||||
avctx->channels);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
avctx->frame_size = NBLOCKS * BLOCKSIZE;
|
avctx->frame_size = NBLOCKS * BLOCKSIZE;
|
||||||
avctx->initial_padding = avctx->frame_size;
|
avctx->initial_padding = avctx->frame_size;
|
||||||
avctx->bit_rate = 8000;
|
avctx->bit_rate = 8000;
|
||||||
@@ -554,6 +549,9 @@ const AVCodec ff_ra_144_encoder = {
|
|||||||
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
|
.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
|
||||||
AV_SAMPLE_FMT_NONE },
|
AV_SAMPLE_FMT_NONE },
|
||||||
.supported_samplerates = (const int[]){ 8000, 0 },
|
.supported_samplerates = (const int[]){ 8000, 0 },
|
||||||
|
#if FF_API_OLD_CHANNEL_LAYOUT
|
||||||
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO, 0 },
|
.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,
|
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user