Commit e47ebb78 authored by michael's avatar michael

Print sane error message for channels != 1.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13786 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 713664b3
...@@ -324,7 +324,7 @@ static av_cold int g726_init(AVCodecContext * avctx) ...@@ -324,7 +324,7 @@ static av_cold int g726_init(AVCodecContext * avctx)
AVG726Context* c = (AVG726Context*)avctx->priv_data; AVG726Context* c = (AVG726Context*)avctx->priv_data;
unsigned int index= (avctx->bit_rate + avctx->sample_rate/2) / avctx->sample_rate - 2; 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 != 16000 && avctx->bit_rate != 24000 &&
avctx->bit_rate != 32000 && avctx->bit_rate != 40000)) { avctx->bit_rate != 32000 && avctx->bit_rate != 40000)) {
av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n"); av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");
...@@ -334,6 +334,10 @@ static av_cold int g726_init(AVCodecContext * avctx) ...@@ -334,6 +334,10 @@ static av_cold int g726_init(AVCodecContext * avctx)
av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n"); av_log(avctx, AV_LOG_ERROR, "G726: unsupported audio format\n");
return -1; return -1;
} }
if(avctx->channels != 1){
av_log(avctx, AV_LOG_ERROR, "Only mono is supported\n");
return -1;
}
if(index>3){ if(index>3){
av_log(avctx, AV_LOG_ERROR, "Unsupported number of bits %d\n", index+2); av_log(avctx, AV_LOG_ERROR, "Unsupported number of bits %d\n", index+2);
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment