summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2023-08-06 11:41:14 +0800
committerPhilip Langdale <github.philipl@overt.org>2023-08-06 04:42:13 -0700
commite8144ac231e47e96a99dd0ab9ec9499c5bd2ddfe (patch)
tree348dbaa73f0c47a571b240ba95409a5086f20012 /video
parent6729285502dd538b1d5ca068816e204671864256 (diff)
downloadmpv-e8144ac231e47e96a99dd0ab9ec9499c5bd2ddfe.tar.bz2
mpv-e8144ac231e47e96a99dd0ab9ec9499c5bd2ddfe.tar.xz
vd_lavc: repeatedly attempt to fallback if hwdec fails in reinit
In the same way that fallback in receive_frame() needs to be repeated until we get a working decoder, we have to do the same thing in reinit(). Calling force_fallback() only once can still yield a non functional decoder. The reason why we have these multiple paths which each require their own fallback logic is that we can fail at different stages: * hwdec init * decoder init <- repeated fallback was missing here * frame decoding Fixes #12084
Diffstat (limited to 'video')
-rw-r--r--video/decode/vd_lavc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 2106dcb56e..0c87005ddd 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -659,8 +659,11 @@ static void reinit(struct mp_filter *vd)
bool use_hwdec = ctx->use_hwdec;
init_avctx(vd);
- if (!ctx->avctx && use_hwdec)
- force_fallback(vd);
+ if (!ctx->avctx && use_hwdec) {
+ do {
+ force_fallback(vd);
+ } while (!ctx->avctx);
+ }
}
static void init_avctx(struct mp_filter *vd)