On 14 August 2010 05:58, Stefano Sabatini <[email protected]> wrote: > On date Wednesday 2010-08-11 22:05:02 +0530, Mohamed Naufal encoded: >> --- >> libavcodec/Makefile | 1 + >> libavcodec/allcodecs.c | 2 +- >> libavcodec/g723_1.c | 68 >> ++++++++++++++++++++++++++++++++++++++++++++++++ >> 3 files changed, 70 insertions(+), 1 deletions(-) > [...] >> --- a/libavcodec/g723_1.c >> +++ b/libavcodec/g723_1.c >> @@ -1075,3 +1075,71 @@ AVCodec g723_1_decoder = { >> .long_name = NULL_IF_CONFIG_SMALL("G.723.1"), >> .capabilities = CODEC_CAP_SUBFRAMES, >> }; >> + >> +#if CONFIG_G723_1_ENCODER >> +static av_cold int g723_1_encode_init(AVCodecContext *avctx) >> +{ >> + G723_1_Context *p = avctx->priv_data; >> + >> + if (avctx->sample_rate != 8000) { >> + av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n"); >> + return -1; >> + } >> + >> + if (avctx->channels != 1) { >> + av_log(avctx, AV_LOG_ERROR, "Only mono supported\n"); >> + return -1; >> + } >> + >> + if (avctx->bit_rate == 6300) { >> + p->cur_rate = Rate6k3; >> + } else if (avctx->bit_rate == 5300) { >> + p->cur_rate = Rate5k3; >> + } else { >> + av_log(avctx, AV_LOG_ERROR, >> + "Bitrate not supported, use either 5.3k or 6.3k\n"); >> + return -1; > > Uhm, please use AVERROR(EINVAL)/AVERROR_PATCHWELCOME rather than -1. >
Fixed. Thanks Naufal _______________________________________________ FFmpeg-soc mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc
