diff options
author | wm4 <wm4@nowhere> | 2017-01-11 08:26:32 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-01-11 08:26:32 +0100 |
commit | ee66efeb99ef806ef6eb1ee854d68dbf19fdcb91 (patch) | |
tree | aa7dcac2a0901b4460904a456fd017e3c864a314 /video | |
parent | c000b37e9abd926fffff79c4f3056e1700a0e849 (diff) | |
download | mpv-ee66efeb99ef806ef6eb1ee854d68dbf19fdcb91.tar.bz2 mpv-ee66efeb99ef806ef6eb1ee854d68dbf19fdcb91.tar.xz |
vd_lavc: return proper error codes from get_buffer2 callback
-1 is essentially random and usually the same as AVERROR(EPERM).
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/vd_lavc.c | 4 |
1 files changed, 2 insertions, 2 deletions
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]; |