summaryrefslogtreecommitdiff
path: root/libavcodec/libspeexdec.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-10-21 12:13:04 -0400
committerJustin Ruggles <justin.ruggles@gmail.com>2011-10-21 17:07:04 -0400
commita470fe80ba21513c29e319d968f87f1379a97d16 (patch)
tree6301cf0fdde48a294a64297e0d54f8a742ba4b0a /libavcodec/libspeexdec.c
parent14bc60dbaeb10cb95bd47902067984de88e0315e (diff)
libspeexdec: return meaningful error codes
Diffstat (limited to 'libavcodec/libspeexdec.c')
-rw-r--r--libavcodec/libspeexdec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c
index 69742297f0..f66331ea93 100644
--- a/libavcodec/libspeexdec.c
+++ b/libavcodec/libspeexdec.c
@@ -60,14 +60,14 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx)
mode = speex_lib_get_mode(s->header->mode);
if (!mode) {
av_log(avctx, AV_LOG_ERROR, "Unknown Speex mode %d", s->header->mode);
- return -1;
+ return AVERROR_INVALIDDATA;
}
} else
av_log(avctx, AV_LOG_INFO, "Missing Speex header, assuming defaults.\n");
if (avctx->channels > 2) {
av_log(avctx, AV_LOG_ERROR, "Only stereo and mono are supported.\n");
- return -1;
+ return AVERROR(EINVAL);
}
speex_bits_init(&s->bits);
@@ -128,7 +128,7 @@ static int libspeex_decode_frame(AVCodecContext *avctx,
ret = speex_decode_int(s->dec_state, &s->bits, output);
if (ret <= -2) {
av_log(avctx, AV_LOG_ERROR, "Error decoding Speex frame.\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
if (avctx->channels == 2)
speex_decode_stereo_int(output, s->frame_size, &s->stereo);