Unified · Split
| @@ -61,11 +61,6 @@ static av_cold int g722_encode_init(AVCodecContext * avctx) · 60 unmodified lines | ||
| 61 | 61 | G722Context *c = avctx->priv_data; |
| 62 | 62 | int ret; |
| 63 | 63 | |
| 64 | − if (avctx->channels != 1) { | |
| 65 | − av_log(avctx, AV_LOG_ERROR, "Only mono tracks are allowed.\n"); | |
| 66 | − return AVERROR_INVALIDDATA; | |
| 67 | − } | |
| 68 | − | |
| 69 | 64 | c->band[0].scale_factor = 8; |
| 70 | 65 | c->band[1].scale_factor = 2; |
| 71 | 66 | c->prev_samples_pos = 22; |
| @@ -381,15 +376,15 @@ static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, · 309 unmodified lines | ||
| 381 | 376 | } |
| 382 | 377 | |
| 383 | 378 | 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 }, | |
| 395 | 390 | }; |