diff options
author | wm4 <wm4@nowhere> | 2012-09-22 05:13:29 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-12 10:10:31 +0200 |
commit | 9939776e5ee70818d9cc4a5a7cd9f09da4239164 (patch) | |
tree | 78fcbc6d3604f6fb39a70b02e4057e487d3b4f62 /input | |
parent | d3562198249d51087e8a23a6fafafd140eaaf935 (diff) | |
download | mpv-9939776e5ee70818d9cc4a5a7cd9f09da4239164.tar.bz2 mpv-9939776e5ee70818d9cc4a5a7cd9f09da4239164.tar.xz |
commands: make "aspect" property writeable, replaces "switch_ratio"
Move the code for "switch_ratio" to the M_PROPERTY_SET case of the
"aspect" property. The rules are exactly the same, e.g. setting a ratio
smaller than 0.1 sets the pixel aspect ratio to 1:1. For now, we define
that writing "0" sets the PAR to 1:1, and disallow -1 (possibly reserve
it to reset to default aspect ratio).
Diffstat (limited to 'input')
-rw-r--r-- | input/input.c | 6 | ||||
-rw-r--r-- | input/input.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/input/input.c b/input/input.c index d783f53aca..d3ad18075d 100644 --- a/input/input.c +++ b/input/input.c @@ -126,7 +126,6 @@ static const mp_cmd_t mp_cmds[] = { #ifdef CONFIG_DVBIN { MP_CMD_DVB_SET_CHANNEL, "dvb_set_channel", { ARG_INT, ARG_INT } }, #endif - { MP_CMD_SWITCH_RATIO, "switch_ratio", { OARG_FLOAT(0) } }, { MP_CMD_SCREENSHOT, "screenshot", { OARG_INT(0), OARG_INT(0) } }, { MP_CMD_LOADFILE, "loadfile", { ARG_STRING, OARG_INT(0) } }, { MP_CMD_LOADLIST, "loadlist", { ARG_STRING, OARG_INT(0) } }, @@ -199,9 +198,12 @@ static const struct legacy_cmd legacy_cmds[] = { {"osd_show_text", "show_text"}, {"osd_show_property_text", "show_text"}, {"osd_show_progression", "show_progress"}, - // Approximate + // Approximate (can fail if user added additional whitespace) {"pt_step 1", "playlist_next"}, {"pt_step -1", "playlist_prev"}, + // Switch_ratio without argument resets aspect ratio + {"switch_ratio ", "set aspect "}, + {"switch_ratio", "set aspect 0"}, {0} }; diff --git a/input/input.h b/input/input.h index 0fa5c32971..158d71b8ac 100644 --- a/input/input.h +++ b/input/input.h @@ -41,7 +41,6 @@ enum mp_command_type { MP_CMD_TV_LAST_CHANNEL, MP_CMD_TV_SET_FREQ, MP_CMD_TV_SET_NORM, - MP_CMD_SWITCH_RATIO, MP_CMD_FRAME_STEP, MP_CMD_SPEED_MULT, MP_CMD_RUN, |