aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukasz Marek <lukasz.m.luki2@gmail.com>2014-12-03 00:35:51 +0100
committerLukasz Marek <lukasz.m.luki2@gmail.com>2014-12-03 22:20:22 +0100
commit650aa36f3581f86214766ca0f52cd022eff817d6 (patch)
tree90b55c846ddf72cd72ac43aed53443444a4b2c5f
parent8524558858b7e14bc50afa10233e0194f591ab9d (diff)
downloadffmpeg-650aa36f3581f86214766ca0f52cd022eff817d6.tar.gz
lavf/oggenc: use meaningful error codes
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
-rw-r--r--libavformat/oggenc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index dda229e04f..f3413c54c9 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -348,7 +348,7 @@ static int ogg_build_speex_headers(AVCodecContext *avctx,
uint8_t *p;
if (avctx->extradata_size < SPEEX_HEADER_SIZE)
- return -1;
+ return AVERROR_INVALIDDATA;
// first packet: Speex header
p = av_mallocz(SPEEX_HEADER_SIZE);
@@ -377,7 +377,7 @@ static int ogg_build_opus_headers(AVCodecContext *avctx,
uint8_t *p;
if (avctx->extradata_size < OPUS_HEADER_SIZE)
- return -1;
+ return AVERROR_INVALIDDATA;
/* first packet: Opus header */
p = av_mallocz(avctx->extradata_size);
@@ -446,12 +446,12 @@ static int ogg_write_header(AVFormatContext *s)
st->codec->codec_id != AV_CODEC_ID_FLAC &&
st->codec->codec_id != AV_CODEC_ID_OPUS) {
av_log(s, AV_LOG_ERROR, "Unsupported codec id in stream %d\n", i);
- return -1;
+ return AVERROR(EINVAL);
}
if (!st->codec->extradata || !st->codec->extradata_size) {
av_log(s, AV_LOG_ERROR, "No extradata present\n");
- return -1;
+ return AVERROR_INVALIDDATA;
}
oggstream = av_mallocz(sizeof(*oggstream));
if (!oggstream)
@@ -511,7 +511,7 @@ static int ogg_write_header(AVFormatContext *s)
oggstream->header, oggstream->header_len) < 0) {
av_log(s, AV_LOG_ERROR, "Extradata corrupted\n");
av_freep(&st->priv_data);
- return -1;
+ return AVERROR_INVALIDDATA;
}
p = ogg_write_vorbiscomment(7, s->flags & AVFMT_FLAG_BITEXACT,