From ee66efeb99ef806ef6eb1ee854d68dbf19fdcb91 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 11 Jan 2017 08:26:32 +0100 Subject: vd_lavc: return proper error codes from get_buffer2 callback -1 is essentially random and usually the same as AVERROR(EPERM). --- video/decode/vd_lavc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'video') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 4a213b07dc..919fb9e2dd 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -739,11 +739,11 @@ static int get_buffer2_hwdec(AVCodecContext *avctx, AVFrame *pic, int flags) int h = pic->height; if (imgfmt != ctx->hwdec_fmt && w != ctx->hwdec_w && h != ctx->hwdec_h) - return -1; + return AVERROR(EINVAL); struct mp_image *mpi = ctx->hwdec->allocate_image(ctx, w, h); if (!mpi) - return -1; + return AVERROR(ENOMEM); for (int i = 0; i < 4; i++) { pic->data[i] = mpi->planes[i]; -- cgit v1.2.3