summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-03 23:35:28 +0100
committerwm4 <wm4@nowhere>2013-12-04 00:07:40 +0100
commita605fae6fac98218d18b1f24e78cf307a2b998aa (patch)
tree85cdd3e604c9d01605e576def37db43c781052dc /video
parente92f4d47264aa2fd81f39e6c6fcaffb1ec134c7b (diff)
downloadmpv-a605fae6fac98218d18b1f24e78cf307a2b998aa.tar.bz2
mpv-a605fae6fac98218d18b1f24e78cf307a2b998aa.tar.xz
vf_ilpack: use option parser
Diffstat (limited to 'video')
-rw-r--r--video/filter/vf_ilpack.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/video/filter/vf_ilpack.c b/video/filter/vf_ilpack.c
index 136e8917ed..f3bef4fa19 100644
--- a/video/filter/vf_ilpack.c
+++ b/video/filter/vf_ilpack.c
@@ -24,6 +24,7 @@
#include "config.h"
#include "mpvcore/mp_msg.h"
#include "mpvcore/cpudetect.h"
+#include "mpvcore/m_option.h"
#include "video/img_format.h"
#include "video/mp_image.h"
@@ -408,9 +409,6 @@ static int vf_open(vf_instance_t *vf, char *args)
vf->config=config;
vf->query_format=query_format;
vf->filter=filter;
- vf->priv = calloc(1, sizeof(struct vf_priv_s));
- vf->priv->mode = 1;
- if (args) sscanf(args, "%d", &vf->priv->mode);
pack_nn = pack_nn_C;
pack_li_0 = pack_li_0_C;
@@ -429,11 +427,6 @@ static int vf_open(vf_instance_t *vf, char *args)
case 0:
vf->priv->pack[0] = vf->priv->pack[1] = pack_nn;
break;
- default:
- mp_msg(MSGT_VFILTER, MSGL_WARN,
- "ilpack: unknown mode %d (fallback to linear)\n",
- vf->priv->mode);
- /* Fallthrough */
case 1:
vf->priv->pack[0] = pack_li_0;
vf->priv->pack[1] = pack_li_1;
@@ -443,8 +436,17 @@ static int vf_open(vf_instance_t *vf, char *args)
return 1;
}
+#define OPT_BASE_STRUCT struct vf_priv_s
const vf_info_t vf_info_ilpack = {
.description = "4:2:0 planar -> 4:2:2 packed reinterlacer",
.name = "ilpack",
.open = vf_open,
+ .priv_size = sizeof(struct vf_priv_s),
+ .priv_defaults = &(const struct vf_priv_s){
+ .mode = 1,
+ },
+ .options = (const struct m_option[]){
+ OPT_INTRANGE("mode", mode, 0, 0, 1),
+ {0}
+ },
};