History

avcodec/g722enc: force mono channel layout

Kyle Swanson committed 9 years ago

Commit c11ca611 parent 3c702511 file · +11 −16Browse files

Unified · Split

libavcodec/g722enc.c+11−16
@@ -61,11 +61,6 @@ static av_cold int g722_encode_init(AVCodecContext * avctx) · 60 unmodified lines
6161 G722Context *c = avctx->priv_data;
6262 int ret;
6363
64− if (avctx->channels != 1) {
65− av_log(avctx, AV_LOG_ERROR, "Only mono tracks are allowed.\n");
66− return AVERROR_INVALIDDATA;
67− }
68−
6964 c->band[0].scale_factor = 8;
7065 c->band[1].scale_factor = 2;
7166 c->prev_samples_pos = 22;
@@ -381,15 +376,15 @@ static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 309 unmodified lines
381376 }
382377
383378 AVCodec ff_adpcm_g722_encoder = {
384− .name = "g722",
385− .long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"),
386− .type = AVMEDIA_TYPE_AUDIO,
387− .id = AV_CODEC_ID_ADPCM_G722,
388− .priv_data_size = sizeof(G722Context),
389− .init = g722_encode_init,
390− .close = g722_encode_close,
391− .encode2 = g722_encode_frame,
392− .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME,
393− .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16,
394− AV_SAMPLE_FMT_NONE },
379+ .name = "g722",
380+ .long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"),
381+ .type = AVMEDIA_TYPE_AUDIO,
382+ .id = AV_CODEC_ID_ADPCM_G722,
383+ .priv_data_size = sizeof(G722Context),
384+ .init = g722_encode_init,
385+ .close = g722_encode_close,
386+ .encode2 = g722_encode_frame,
387+ .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME,
388+ .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE },
389+ .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 },
395390 };

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