summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-06-21 18:12:18 +0200
committerwm4 <wm4@nowhere>2017-06-21 18:13:53 +0200
commite30fe38a212d52bca4693941a7cfa9e44b675a66 (patch)
tree82e82339fb6cbf879957c71dedc47b109823cb36
parente62675a8897677844c4670c763c8589d82d867cc (diff)
downloadmpv-e30fe38a212d52bca4693941a7cfa9e44b675a66.tar.bz2
mpv-e30fe38a212d52bca4693941a7cfa9e44b675a66.tar.xz
m_option: make geometry code GPL-only
In commit eb22569ff082b, I claimed that the geometry parsing code was rewritten. But I'm not sure if it's rewritten enough, or if copyright claims could still be made. Given that the original code was self-contained, and could be considered a separate work, it's probably safer (and more up to the standards applied to this relicensing) to leave this as GPL code. The rewrite/code move can be seen with: git diff f2dcdca...ccaed5e
-rw-r--r--options/m_option.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/options/m_option.c b/options/m_option.c
index bec2518b45..db0d327672 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -1841,6 +1841,7 @@ const m_option_type_t m_option_type_color = {
.copy = copy_opt,
};
+#if HAVE_GPL
// Parse a >=0 number starting at s. Set s to the string following the number.
// If the number ends with '%', eat that and set *out_per to true, but only
@@ -2046,6 +2047,37 @@ const m_option_type_t m_option_type_size_box = {
.copy = copy_opt,
};
+#else /* #if HAVE_GPL */
+
+void m_geometry_apply(int *xpos, int *ypos, int *widw, int *widh,
+ int scrw, int scrh, struct m_geometry *gm)
+{
+ // nothing
+}
+
+static int parse_dummy(struct mp_log *log, const m_option_t *opt,
+ struct bstr name, struct bstr param, void *dst)
+{
+ mp_err(log, "Unavailable in LGPL mode.\n");
+ return M_OPT_INVALID;
+}
+
+const m_option_type_t m_option_type_geometry = {
+ .name = "Window geometry",
+ .size = sizeof(struct m_geometry),
+ .parse = parse_dummy,
+ .copy = copy_opt,
+};
+
+const m_option_type_t m_option_type_size_box = {
+ .name = "Window size",
+ .size = sizeof(struct m_geometry),
+ .parse = parse_dummy,
+ .copy = copy_opt,
+};
+
+#endif
+
#include "video/img_format.h"