diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2015-02-11 00:27:35 +0530 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-02-17 12:18:20 -0500 |
commit | a1e2c47cd4fdaa64beda7e6dfa623b65c46f5012 (patch) | |
tree | 4150105254e15ed7101df58ab0b843cf6a2f4fbb /libavcodec/libxvid.c | |
parent | 18f4fa251b0eb36392839f5bf6180f280dc04d8d (diff) | |
download | ffmpeg-a1e2c47cd4fdaa64beda7e6dfa623b65c46f5012.tar.gz |
libxvid: Return meaningful error messages
Diffstat (limited to 'libavcodec/libxvid.c')
-rw-r--r-- | libavcodec/libxvid.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 35a76eb1d6..6486ad1855 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -474,7 +474,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) if (!x->twopassbuffer || !x->old_twopassbuffer) { av_log(avctx, AV_LOG_ERROR, "Xvid: Cannot allocate 2-pass log buffers\n"); - return -1; + return AVERROR(ENOMEM); } x->twopassbuffer[0] = x->old_twopassbuffer[0] = 0; @@ -487,22 +487,22 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) rc2pass2.bitrate = avctx->bit_rate; fd = ff_tempfile("xvidff.", &x->twopassfile); - if (fd == -1) { + if (fd < 0) { av_log(avctx, AV_LOG_ERROR, "Xvid: Cannot write 2-pass pipe\n"); - return -1; + return fd; } if (!avctx->stats_in) { av_log(avctx, AV_LOG_ERROR, "Xvid: No 2-pass information loaded for second pass\n"); - return -1; + return AVERROR_INVALIDDATA; } if (strlen(avctx->stats_in) > write(fd, avctx->stats_in, strlen(avctx->stats_in))) { close(fd); av_log(avctx, AV_LOG_ERROR, "Xvid: Cannot write to 2-pass pipe\n"); - return -1; + return AVERROR(EIO); } close(fd); @@ -770,7 +770,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt, return 0; av_log(avctx, AV_LOG_ERROR, "Xvid: Encoding Error Occurred: %i\n", xerr); - return -1; + return xerr; } } |