From e31fbbeeee2018c9008a7ee160ef4d76221602da Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 24 Mar 2020 23:40:01 +0100 Subject: vd_lavc: make hwdec fallback message more consistent The "rule" is that a fallback warning message should be shown only shown if software decoding was used before, or in other words when either hwdec was enabled before, but the stream suddenly falls back, or it was attempted to enable it at runtime, and it didn't work. The message wasn't printed the first time in the latter case, because hwdec_notified was not set in forced software decoding mode. Fix it with this commit. Fortunately, the logic becomes simpler. --- video/decode/vd_lavc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'video/decode/vd_lavc.c') diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 14f1343d6f..9a647bf50c 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -174,7 +174,6 @@ typedef struct lavc_ctx { bool flushing; struct lavc_state state; const char *decoder; - bool hwdec_requested; bool hwdec_failed; bool hwdec_notified; @@ -468,8 +467,6 @@ static void select_and_set_hwdec(struct mp_filter *vd) int num_hwdecs = 0; add_all_hwdec_methods(&hwdecs, &num_hwdecs); - ctx->hwdec_requested = true; - for (int n = 0; n < num_hwdecs; n++) { struct hwdec_info *hwdec = &hwdecs[n]; @@ -1158,7 +1155,7 @@ static int receive_frame(struct mp_filter *vd, struct mp_frame *out_frame) } } - if (!ctx->hwdec_notified && ctx->hwdec_requested) { + if (!ctx->hwdec_notified) { if (ctx->use_hwdec) { MP_INFO(vd, "Using hardware decoding (%s).\n", ctx->hwdec.method_name); -- cgit v1.2.3