# HG changeset patch # User michael # Date 1213658411 0 # Node ID bb24d15211a4b11d61a72cde0c980d103f6cb3a3 # Parent 167726a9550946b6c6da91da502eff49915997d5 Print sane error message for channels != 1. diff -r 167726a95509 -r bb24d15211a4 g726.c --- a/g726.c Mon Jun 16 23:16:44 2008 +0000 +++ b/g726.c Mon Jun 16 23:20:11 2008 +0000 @@ -324,7 +324,7 @@ AVG726Context* c = (AVG726Context*)avctx->priv_data; unsigned int index= (avctx->bit_rate + avctx->sample_rate/2) / avctx->sample_rate - 2; - if (avctx->channels != 1 || + if ( (avctx->bit_rate != 16000 && avctx->bit_rate != 24000 && avctx->bit_rate != 32000 && avctx->bit_rate != 40000)) { av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n"); @@ -334,6 +334,10 @@ av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n"); return -1; } + if(avctx->channels != 1){ + av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n"); + return -1; + } if(index>3){ av_log(avctx, AV_LOG_ERROR, "Unsupported number of bits %d\n", index+2); return -1;