diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-06-16 23:20:11 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-06-16 23:20:11 +0000 |
commit | 8b470cc54200bc0f76c57565fee81ff110f11df0 (patch) | |
tree | 6b2ab63d5fe9bd6c954610c2a2bdeabf5a61b21f /libavcodec/g726.c | |
parent | 35d0e16ba12ab439c9155b9dd3bf8ba46c8bf517 (diff) | |
download | ffmpeg-8b470cc54200bc0f76c57565fee81ff110f11df0.tar.gz |
Print sane error message for channels != 1.
Originally committed as revision 13786 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/g726.c')
-rw-r--r-- | libavcodec/g726.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/g726.c b/libavcodec/g726.c index 13dce4f590..385d6fde96 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -324,7 +324,7 @@ static av_cold int g726_init(AVCodecContext * avctx) 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 @@ static av_cold int g726_init(AVCodecContext * avctx) 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; |