summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-17 11:03:42 +0100
committerwm4 <wm4@nowhere>2017-01-17 15:48:56 +0100
commit9d69eae16252e131788656ba0b8e151c4cabd1de (patch)
treeb0c2df25e8fe7e6829196a4f081af0af8e280ea4 /video
parentff9f2c4b6eed6cd85488290200d2345015c5bf06 (diff)
downloadmpv-9d69eae16252e131788656ba0b8e151c4cabd1de.tar.bz2
mpv-9d69eae16252e131788656ba0b8e151c4cabd1de.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/decode/vd_lavc.c1
1 files changed, 1 insertions, 0 deletions
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;
}