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.
This commit is contained in:
wm4 2017-01-17 11:03:42 +01:00
parent ff9f2c4b6e
commit 9d69eae162
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}