From 0d5e4ba7991cad632bde45790bd52b77b856d3a5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 3 Dec 2013 23:42:49 +0100 Subject: vf_rotate: use option parser --- video/filter/vf_rotate.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/video/filter/vf_rotate.c b/video/filter/vf_rotate.c index 58cac932ff..69f5b30d96 100644 --- a/video/filter/vf_rotate.c +++ b/video/filter/vf_rotate.c @@ -23,6 +23,7 @@ #include "config.h" #include "mpvcore/mp_msg.h" +#include "mpvcore/m_option.h" #include "video/img_format.h" #include "video/mp_image.h" @@ -119,15 +120,19 @@ static int vf_open(vf_instance_t *vf, char *args){ vf->reconfig=reconfig; vf->filter=filter; vf->query_format=query_format; - vf->priv=malloc(sizeof(struct vf_priv_s)); - vf->priv->direction=args?atoi(args):0; return 1; } +#define OPT_BASE_STRUCT struct vf_priv_s const vf_info_t vf_info_rotate = { .description = "rotate", .name = "rotate", .open = vf_open, + .priv_size = sizeof(struct vf_priv_s), + .options = (const struct m_option[]){ + OPT_INTRANGE("direction", direction, 0, 0, 7), + {0} + }, }; //===========================================================================// -- cgit v1.2.3