libx264: Return more meaningful error codes

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
Himangi Saraogi 2015-03-12 21:50:13 +05:30 committed by Luca Barbato
parent 6bdae41d3e
commit 913aa9a487
1 changed files with 3 additions and 3 deletions

View File

@ -235,11 +235,11 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
} }
do { do {
if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0) if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0)
return -1; return AVERROR_UNKNOWN;
ret = encode_nals(ctx, pkt, nal, nnal); ret = encode_nals(ctx, pkt, nal, nnal);
if (ret < 0) if (ret < 0)
return -1; return ret;
} while (!ret && !frame && x264_encoder_delayed_frames(x4->enc)); } while (!ret && !frame && x264_encoder_delayed_frames(x4->enc));
pkt->pts = pic_out.i_pts; pkt->pts = pic_out.i_pts;
@ -518,7 +518,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->enc = x264_encoder_open(&x4->params); x4->enc = x264_encoder_open(&x4->params);
if (!x4->enc) if (!x4->enc)
return -1; return AVERROR_UNKNOWN;
avctx->coded_frame = av_frame_alloc(); avctx->coded_frame = av_frame_alloc();
if (!avctx->coded_frame) if (!avctx->coded_frame)