[FFmpeg-cvslog] mpegaudioenc: return AVERROR codes instead of -1

Justin Ruggles git at videolan.org
Sun Feb 26 05:21:46 CET 2012


ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Tue Feb 21 15:27:23 2012 -0500| [be60eec6680e51e4bab7599bdf90e34d837a6eae] | committer: Justin Ruggles

mpegaudioenc: return AVERROR codes instead of -1

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=be60eec6680e51e4bab7599bdf90e34d837a6eae
---

 libavcodec/mpegaudioenc.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c
index 455c4b2..9ee7f2c 100644
--- a/libavcodec/mpegaudioenc.c
+++ b/libavcodec/mpegaudioenc.c
@@ -75,7 +75,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
 
     if (channels <= 0 || channels > 2){
         av_log(avctx, AV_LOG_ERROR, "encoding %d channel(s) is not allowed in mp2\n", channels);
-        return -1;
+        return AVERROR(EINVAL);
     }
     bitrate = bitrate / 1000;
     s->nb_channels = channels;
@@ -93,7 +93,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
     }
     if (i == 3){
         av_log(avctx, AV_LOG_ERROR, "Sampling rate %d is not allowed in mp2\n", freq);
-        return -1;
+        return AVERROR(EINVAL);
     }
     s->freq_index = i;
 
@@ -104,7 +104,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
     }
     if (i == 15){
         av_log(avctx, AV_LOG_ERROR, "bitrate %d is not allowed in mp2\n", bitrate);
-        return -1;
+        return AVERROR(EINVAL);
     }
     s->bitrate_index = i;
 



More information about the ffmpeg-cvslog mailing list