summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-04 16:07:43 +0200
committerwm4 <wm4@nowhere>2014-05-04 16:07:43 +0200
commit70ffbbe92769de54d76d09fb3856ea87df80006e (patch)
tree68d7c7b2e9f5e1fca1a2681b0e20849e38988f4b /video/filter
parentaa2a9c3e42bac90d097506f46694b7c6c1c7dfc6 (diff)
downloadmpv-70ffbbe92769de54d76d09fb3856ea87df80006e.tar.bz2
mpv-70ffbbe92769de54d76d09fb3856ea87df80006e.tar.xz
vf: print for which filter initialization failed
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf.c12
-rw-r--r--video/filter/vf.h3
2 files changed, 11 insertions, 4 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c
index 6749134b05..32a376af3f 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -240,7 +240,8 @@ static void print_fmt(struct mp_log *log, int msglevel, struct mp_image_params *
}
}
-void vf_print_filter_chain(struct vf_chain *c, int msglevel)
+void vf_print_filter_chain(struct vf_chain *c, int msglevel,
+ struct vf_instance *vf)
{
if (!mp_msg_test(c->log, msglevel))
return;
@@ -253,6 +254,8 @@ void vf_print_filter_chain(struct vf_chain *c, int msglevel)
print_fmt(c->log, msglevel, &f->fmt_out);
if (f->autoinserted)
mp_msg(c->log, msglevel, " [a]");
+ if (f == vf)
+ mp_msg(c->log, msglevel, " <---");
mp_msg(c->log, msglevel, "\n");
}
}
@@ -601,10 +604,13 @@ int vf_reconfig(struct vf_chain *c, const struct mp_image_params *params,
uint8_t unused[IMGFMT_END - IMGFMT_START];
update_formats(c, c->first, unused);
+ struct vf_instance *failing = NULL;
for (struct vf_instance *vf = c->first; vf; vf = vf->next) {
r = vf_reconfig_wrapper(vf, &cur);
- if (r < 0)
+ if (r < 0) {
+ failing = vf;
break;
+ }
cur = vf->fmt_out;
}
c->output_params = cur;
@@ -613,7 +619,7 @@ int vf_reconfig(struct vf_chain *c, const struct mp_image_params *params,
if (r == -2)
MP_ERR(c, "Image formats incompatible.\n");
mp_msg(c->log, loglevel, "Video filter chain:\n");
- vf_print_filter_chain(c, loglevel);
+ vf_print_filter_chain(c, loglevel, failing);
if (r < 0) {
c->input_params = c->override_params = c->output_params =
(struct mp_image_params){0};
diff --git a/video/filter/vf.h b/video/filter/vf.h
index 86e545aa01..0e3a02b3a2 100644
--- a/video/filter/vf.h
+++ b/video/filter/vf.h
@@ -149,7 +149,8 @@ struct vf_instance *vf_append_filter(struct vf_chain *c, const char *name,
void vf_remove_filter(struct vf_chain *c, struct vf_instance *vf);
int vf_append_filter_list(struct vf_chain *c, struct m_obj_settings *list);
struct vf_instance *vf_find_by_label(struct vf_chain *c, const char *label);
-void vf_print_filter_chain(struct vf_chain *c, int msglevel);
+void vf_print_filter_chain(struct vf_chain *c, int msglevel,
+ struct vf_instance *vf);
// Filter internal API
struct mp_image *vf_alloc_out_image(struct vf_instance *vf);