Unified · Split
| @@ -61,11 +61,6 @@ static av_cold int g722_encode_init(AVCodecContext * avctx) · 60 unmodified lines | |||
| 61 | G722Context *c = avctx->priv_data; | 61 | G722Context *c = avctx->priv_data; |
| 62 | int ret; | 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 | c->band[0].scale_factor = 8; | 64 | c->band[0].scale_factor = 8; |
| 70 | c->band[1].scale_factor = 2; | 65 | c->band[1].scale_factor = 2; |
| 71 | c->prev_samples_pos = 22; | 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 | AVCodec ff_adpcm_g722_encoder = { | 378 | AVCodec ff_adpcm_g722_encoder = { |
| 384 | .name = "g722", | 379 | .name = "g722", |
| 385 | .long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), | 380 | .long_name = NULL_IF_CONFIG_SMALL("G.722 ADPCM"), |
| 386 | .type = AVMEDIA_TYPE_AUDIO, | 381 | .type = AVMEDIA_TYPE_AUDIO, |
| 387 | .id = AV_CODEC_ID_ADPCM_G722, | 382 | .id = AV_CODEC_ID_ADPCM_G722, |
| 388 | .priv_data_size = sizeof(G722Context), | 383 | .priv_data_size = sizeof(G722Context), |
| 389 | .init = g722_encode_init, | 384 | .init = g722_encode_init, |
| 390 | .close = g722_encode_close, | 385 | .close = g722_encode_close, |
| 391 | .encode2 = g722_encode_frame, | 386 | .encode2 = g722_encode_frame, |
| 392 | .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, | 387 | .capabilities = AV_CODEC_CAP_SMALL_LAST_FRAME, |
| 393 | .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | 388 | .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, |
| 394 | AV_SAMPLE_FMT_NONE }, | 389 | .channel_layouts = (const uint64_t[]){ AV_CH_LAYOUT_MONO, 0 }, |
| 395 | }; | 390 | }; |