diff options
author | wm4 <wm4@nowhere> | 2015-02-04 23:15:14 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-04 23:15:14 +0100 |
commit | 9248f75853f8b316d0aca1cb3960e53df12b1331 (patch) | |
tree | 2f0b27b91c077ebd7a1714d665f0627333fb0d69 /options | |
parent | 868d0f1e831eaf303ff8f198577583b2fadc67d4 (diff) | |
download | mpv-9248f75853f8b316d0aca1cb3960e53df12b1331.tar.bz2 mpv-9248f75853f8b316d0aca1cb3960e53df12b1331.tar.xz |
options: allow things like --geometry=x50
Although the use is somewhat questionable, it seems strange that e.g.
--geometry=50% works (and sets the width only), but setting the height
only in a similar manner does not work.
Diffstat (limited to 'options')
-rw-r--r-- | options/m_option.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/options/m_option.c b/options/m_option.c index fb3d48c46b..de65587884 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -1801,7 +1801,7 @@ static bool parse_geometry_str(struct m_geometry *gm, bstr s) if (s.len == 0) return true; // Approximate grammar: - // [W[xH]][{+-}X{+-}Y] | [X:Y] + // [[W][xH]][{+-}X{+-}Y] | [X:Y] // (meaning: [optional] {one character of} one|alternative) // Every number can be followed by '%' int num; @@ -1825,7 +1825,8 @@ static bool parse_geometry_str(struct m_geometry *gm, bstr s) if (bstrchr(s, ':') < 0) { gm->wh_valid = true; if (!bstr_startswith0(s, "+") && !bstr_startswith0(s, "-")) { - READ_NUM(w, w_per); + if (!bstr_startswith0(s, "x")) + READ_NUM(w, w_per); if (bstr_eatstart0(&s, "x")) READ_NUM(h, h_per); } |