summaryrefslogtreecommitdiff
path: root/libavcodec/libmp3lame.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2011-10-28 18:44:28 +0200
committerStefano Sabatini <stefasab@gmail.com>2011-10-30 21:10:54 +0100
commit5b1a06b1c9c596b3c406ea632a252dcccbee25ed (patch)
tree0e82c8c924dabb0fc1c490f4fe7ce28441bcc60d /libavcodec/libmp3lame.c
parentb264e5ca135b103eede3e8caa1ac5afb60a64905 (diff)
libmp3lame: log error message in case of invalid number of channels
Also return meaningful error number in place of -1. Improve feedback.
Diffstat (limited to 'libavcodec/libmp3lame.c')
-rw-r--r--libavcodec/libmp3lame.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c
index fcefa2915e..b540362d5c 100644
--- a/libavcodec/libmp3lame.c
+++ b/libavcodec/libmp3lame.c
@@ -49,8 +49,11 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx)
{
Mp3AudioContext *s = avctx->priv_data;
- if (avctx->channels > 2)
- return -1;
+ if (avctx->channels > 2) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Invalid number of channels %d, must be <= 2\n", avctx->channels);
+ return AVERROR(EINVAL);
+ }
s->stereo = avctx->channels > 1 ? 1 : 0;