Browse Source

libmp3lame: log error message in case of invalid number of channels

Also return meaningful error number in place of -1.
Improve feedback.
tags/n0.9
Stefano Sabatini 14 years ago
parent
commit
5b1a06b1c9
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      libavcodec/libmp3lame.c

+ 5
- 2
libavcodec/libmp3lame.c View File

@@ -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;



Loading…
Cancel
Save