History

cng: convert to new channel layout API

Anton Khirnov committed 13 years ago

Commit cdde7fe1 parent 1d2f7e02 files · +3 −6Browse files

Unified · Split

2 files
  1. libavcodec/cngdec.c +2 −1
  2. libavcodec/cngenc.c +1 −5
libavcodec/cngdec.c+2−1
@@ -56,7 +56,8 @@ static av_cold int cng_decode_init(AVCodecContext *avctx) · 55 unmodified lines
56 CNGContext *p = avctx->priv_data;56 CNGContext *p = avctx->priv_data;
57 57
58 avctx->sample_fmt = AV_SAMPLE_FMT_S16;58 avctx->sample_fmt = AV_SAMPLE_FMT_S16;
59 avctx->channels = 1;59 av_channel_layout_uninit(&avctx->ch_layout);
60 avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
60 avctx->sample_rate = 8000;61 avctx->sample_rate = 8000;
61 62
62 p->order = 12;63 p->order = 12;
libavcodec/cngenc.c+1−5
@@ -48,11 +48,6 @@ static av_cold int cng_encode_init(AVCodecContext *avctx) · 47 unmodified lines
48 CNGContext *p = avctx->priv_data;48 CNGContext *p = avctx->priv_data;
49 int ret;49 int ret;
50 50
51 if (avctx->channels != 1) {
52 av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
53 return AVERROR(EINVAL);
54 }
55
56 avctx->frame_size = 640;51 avctx->frame_size = 640;
57 p->order = 10;52 p->order = 10;
58 if ((ret = ff_lpc_init(&p->lpc, avctx->frame_size, p->order, FF_LPC_TYPE_LEVINSON)) < 0)53 if ((ret = ff_lpc_init(&p->lpc, avctx->frame_size, p->order, FF_LPC_TYPE_LEVINSON)) < 0)
@@ -113,5 +108,6 @@ const AVCodec ff_comfortnoise_encoder = { · 54 unmodified lines
113 .close = cng_encode_close,108 .close = cng_encode_close,
114 .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,109 .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
115 AV_SAMPLE_FMT_NONE },110 AV_SAMPLE_FMT_NONE },
111 .ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } },
116 .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,112 .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
117};113};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t