mirror of https://github.com/mpv-player/mpv
vd_lavc: return proper error codes from get_buffer2 callback
-1 is essentially random and usually the same as AVERROR(EPERM).
This commit is contained in:
parent
c000b37e9a
commit
ee66efeb99
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue