summaryrefslogtreecommitdiffstats
path: root/video/decode/vd_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-03-24 23:40:01 +0100
committerwm4 <wm4@nowhere>2020-03-24 23:40:01 +0100
commite31fbbeeee2018c9008a7ee160ef4d76221602da (patch)
tree14917618e9977414ec5499cf40e0f66eba236b7c /video/decode/vd_lavc.c
parent7768452f2d9e1f22e4b6ac3d8ec7bb0fee7b13a6 (diff)
downloadmpv-e31fbbeeee2018c9008a7ee160ef4d76221602da.tar.bz2
mpv-e31fbbeeee2018c9008a7ee160ef4d76221602da.tar.xz
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.
Diffstat (limited to 'video/decode/vd_lavc.c')
-rw-r--r--video/decode/vd_lavc.c5
1 files changed, 1 insertions, 4 deletions
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);