From 41365313433875b0ac2f1fa0e6d14ffa4f5e4e8d Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 12 Nov 2014 19:19:16 +0100 Subject: video: move formatting of image parameters to separate function --- video/filter/vf.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'video/filter') diff --git a/video/filter/vf.c b/video/filter/vf.c index 8fd2da5e88..bf3f73c0e6 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -230,25 +230,6 @@ static int vf_default_query_format(struct vf_instance *vf, unsigned int fmt) return vf_next_query_format(vf, fmt); } -static void fmt_cat(char *b, size_t bs, struct mp_image_params *p) -{ - if (p && p->imgfmt) { - mp_snprintf_cat(b, bs, "%dx%d", p->w, p->h); - if (p->w != p->d_w || p->h != p->d_h) - mp_snprintf_cat(b, bs, "->%dx%d", p->d_w, p->d_h); - mp_snprintf_cat(b, bs, " %s", mp_imgfmt_to_name(p->imgfmt)); - mp_snprintf_cat(b, bs, " %s/%s", mp_csp_names[p->colorspace], - mp_csp_levels_names[p->colorlevels]); - mp_snprintf_cat(b, bs, " CL=%d", (int)p->chroma_location); - if (p->outputlevels) - mp_snprintf_cat(b, bs, " out=%s", mp_csp_levels_names[p->outputlevels]); - if (p->rotate) - mp_snprintf_cat(b, bs, " rot=%d", p->rotate); - } else { - mp_snprintf_cat(b, bs, "???"); - } -} - void vf_print_filter_chain(struct vf_chain *c, int msglevel, struct vf_instance *vf) { @@ -257,13 +238,13 @@ void vf_print_filter_chain(struct vf_chain *c, int msglevel, char b[128] = {0}; - fmt_cat(b, sizeof(b), &c->input_params); + mp_snprintf_cat(b, sizeof(b), "%s", mp_image_params_to_str(&c->input_params)); mp_msg(c->log, msglevel, " [vd] %s\n", b); for (vf_instance_t *f = c->first; f; f = f->next) { b[0] = '\0'; mp_snprintf_cat(b, sizeof(b), " [%s] ", f->info->name); - fmt_cat(b, sizeof(b), &f->fmt_out); + mp_snprintf_cat(b, sizeof(b), "%s", mp_image_params_to_str(&f->fmt_out)); if (f->autoinserted) mp_snprintf_cat(b, sizeof(b), " [a]"); if (f == vf) -- cgit v1.2.3