0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

vf: print for which filter initialization failed

This commit is contained in:
wm4 2014-05-04 16:07:43 +02:00
parent aa2a9c3e42
commit 70ffbbe927
2 changed files with 11 additions and 4 deletions

View File

@ -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};

View File

@ -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);