summaryrefslogtreecommitdiffstats
path: root/core/m_option.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-01-23 10:56:27 +0100
committerwm4 <wm4@nowhere>2013-01-23 10:56:27 +0100
commitccaed5eb071319f9d412f42610302765b844f978 (patch)
tree33b609c07b56f06992afa92a3205416e7c3ef913 /core/m_option.h
parent4c56baba4048f8a881253d4fe2f49c2715c77376 (diff)
downloadmpv-ccaed5eb071319f9d412f42610302765b844f978.tar.bz2
mpv-ccaed5eb071319f9d412f42610302765b844f978.tar.xz
options: allow using % for width and height in --geometry
Now all numbers in the --geometry specification can take percentages. Rewrite the parsing of --geometry, because adjusting the sscanf() mess would require adding all the combinations of using and not using %. As a side effect, using % and pixel values can be freely mixed. Keep the aspect if only one of width or height is set. This is more useful in general. Note: there is one semantic change: --geometry=num used to mean setting the window X position, but now it means setting the window width. Apparently this was a mplayer-specific feature (not part of standard X geometry specifications), and it doesn't look like an overly useful feature, so we are fine with breaking it. In general, the new parsing should still adhere to standard X geometry specification (as used by XParseGeometry()).
Diffstat (limited to 'core/m_option.h')
-rw-r--r--core/m_option.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/m_option.h b/core/m_option.h
index ca75d494bb..87fa959992 100644
--- a/core/m_option.h
+++ b/core/m_option.h
@@ -81,6 +81,7 @@ struct m_color {
struct m_geometry {
int x, y, w, h;
bool xy_valid : 1, wh_valid : 1;
+ bool w_per : 1, h_per : 1;
bool x_sign : 1, y_sign : 1, x_per : 1, y_per : 1;
};