Hi,

On Tue, Apr 12, 2011 at 5:58 PM, Martin Storsjö <[email protected]> wrote:
> ---
>  libavcodec/libopencore-amr.c |   18 ++++++++----------
>  libavcodec/libvo-amrwbenc.c  |   17 ++++++-----------
>  2 files changed, 14 insertions(+), 21 deletions(-)
[..]
> -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";
[..]
> +    av_log(log_ctx, AV_LOG_ERROR, "bitrate not supported: use one of ");
> +    for (i = 0; i < 8; i++)
> +        av_log(log_ctx, AV_LOG_ERROR, "%d%s", rates[i].rate,
> +                                              i < 7 ? ", " : "\n");

This isn't a good idea. 2 reasons:
- 1, what if threading is enabled? Threads could basically log
interleaved, and that would lead to garbage on the terminal
- 2, you're printing in decimals instead of in k units now.

What I'd prefer is to keep the nice output that you have now, maybe
put it in a temporary buffer before printing to the terminal (I know,
av_hex_dump_log() has that issue also and I have a patch for that
somewhere). Then lastly, if the bitrate is not right, simply select
the best one. Don't error out. Just print a warning. And then
continue.

Ronald
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to