# HG changeset patch # User diego # Date 1175947055 0 # Node ID e69d9ecaaf84dc61ae79aaa5047b8e2e825c58c0 # Parent d8b17a09a1145107b4d4a89b3011f0d62f0d136f Print a list of valid AMR bitrates if a wrong one is used. patch by Vctor Paesa, wzrlpy arsystel com diff -r d8b17a09a114 -r e69d9ecaaf84 amr.c --- a/amr.c Fri Apr 06 23:16:08 2007 +0000 +++ b/amr.c Sat Apr 07 11:57:35 2007 +0000 @@ -86,6 +86,11 @@ #include "amr_float/interf_enc.h" #endif +static const char *nb_bitrate_unsupported = + "bitrate not supported: use one of 4.75k, 5.15k, 5.9k, 6.7k, 7.4k, 7.95k, 10.2k or 12.2k\n"; +static const char *wb_bitrate_unsupported = + "bitrate not supported: use one of 6.6k, 8.85k, 12.65k, 14.25k, 15.85k, 18.25k, 19.85k, 23.05k, or 23.85k\n"; + /* Common code for fixed and float version*/ typedef struct AMR_bitrates { @@ -217,7 +222,7 @@ if((s->enc_bitrate=getBitrateMode(avctx->bit_rate))<0) { - av_log(avctx, AV_LOG_ERROR, "bitrate not supported\n"); + av_log(avctx, AV_LOG_ERROR, nb_bitrate_unsupported); return -1; } @@ -414,7 +419,7 @@ if((s->enc_bitrate=getBitrateMode(avctx->bit_rate))<0) { - av_log(avctx, AV_LOG_ERROR, "bitrate not supported\n"); + av_log(avctx, AV_LOG_ERROR, nb_bitrate_unsupported); return -1; } @@ -475,7 +480,7 @@ if((s->enc_bitrate=getBitrateMode(avctx->bit_rate))<0) { - av_log(avctx, AV_LOG_ERROR, "bitrate not supported\n"); + av_log(avctx, AV_LOG_ERROR, nb_bitrate_unsupported); return -1; } @@ -591,7 +596,7 @@ if((s->mode=getWBBitrateMode(avctx->bit_rate))<0) { - av_log(avctx, AV_LOG_ERROR, "bitrate not supported\n"); + av_log(avctx, AV_LOG_ERROR, wb_bitrate_unsupported); return -1; } @@ -622,7 +627,7 @@ if((s->mode=getWBBitrateMode(avctx->bit_rate))<0) { - av_log(avctx, AV_LOG_ERROR, "bitrate not supported\n"); + av_log(avctx, AV_LOG_ERROR, wb_bitrate_unsupported); return -1; } size = E_IF_encode(s->state, s->mode, data, frame, s->allow_dtx);