diff options
author | Lukasz Marek <lukasz.m.luki2@gmail.com> | 2014-05-11 05:40:25 +0200 |
---|---|---|
committer | Lukasz Marek <lukasz.m.luki2@gmail.com> | 2014-05-20 00:00:45 +0200 |
commit | 37fa4b9bb9672520fa901b69234ac611bbbd133f (patch) | |
tree | 9cf2af45e7d054fed807dee1c70b4a0bee076dfb /libavformat/audiointerleave.c | |
parent | 2ed9e17ed1793b3b66ed27c0a113676a46eb9871 (diff) | |
download | ffmpeg-37fa4b9bb9672520fa901b69234ac611bbbd133f.tar.gz |
lavf/audiointerleave: return more meaningful error codes
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Diffstat (limited to 'libavformat/audiointerleave.c')
-rw-r--r-- | libavformat/audiointerleave.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/audiointerleave.c b/libavformat/audiointerleave.c index 97bd801aa7..7f580b970d 100644 --- a/libavformat/audiointerleave.c +++ b/libavformat/audiointerleave.c @@ -45,11 +45,11 @@ int ff_audio_interleave_init(AVFormatContext *s, int i; if (!samples_per_frame) - return -1; + return AVERROR(EINVAL); if (!time_base.num) { av_log(s, AV_LOG_ERROR, "timebase not set for audio interleave\n"); - return -1; + return AVERROR(EINVAL); } for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; @@ -60,7 +60,7 @@ int ff_audio_interleave_init(AVFormatContext *s, av_get_bits_per_sample(st->codec->codec_id)) / 8; if (!aic->sample_size) { av_log(s, AV_LOG_ERROR, "could not compute sample size\n"); - return -1; + return AVERROR(EINVAL); } aic->samples_per_frame = samples_per_frame; aic->samples = aic->samples_per_frame; @@ -114,7 +114,7 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt unsigned new_size = av_fifo_size(aic->fifo) + pkt->size; if (new_size > aic->fifo_size) { if (av_fifo_realloc2(aic->fifo, new_size) < 0) - return -1; + return AVERROR(ENOMEM); aic->fifo_size = new_size; } av_fifo_generic_write(aic->fifo, pkt->data, pkt->size, NULL); |