From 9d69eae16252e131788656ba0b8e151c4cabd1de Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 17 Jan 2017 11:03:42 +0100 Subject: vd_lavc: always fail decoding immediately if copying hw surface fails Successful decoding of a frame resets ctx->hwdec_fail_count to 0 - which us ok, but prevents fallback if it fails if --vd-lavc-software-fallback is set to something higher than 1. Just fail it immediately, since failing here always indicates some real error (or OOM), not e.g. a video parsing error or such, which we try to tolerate via the error counter. --- video/decode/vd_lavc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'video') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index a5454056db..19a6336f19 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -982,6 +982,7 @@ static bool receive_frame(struct dec_video *vd, struct mp_image **out_image) res = sw; if (!res) { MP_ERR(vd, "Could not copy back hardware decoded frame.\n"); + ctx->hwdec_fail_count = INT_MAX - 1; // force fallback handle_err(vd); return NULL; } -- cgit v1.2.3