summaryrefslogtreecommitdiffstats
path: root/cfg-mplayer.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-12-18 01:00:28 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-12-18 10:14:25 +0200
commit7e366113f75c696ae2b32f5faa5f80ec3fca96b8 (patch)
treea205a59524df6a617c8a33afb17cce983a6a2901 /cfg-mplayer.h
parent00c2bafb0ac25a9c5ce845f49f6718b06ff03bbe (diff)
downloadmpv-7e366113f75c696ae2b32f5faa5f80ec3fca96b8.tar.bz2
mpv-7e366113f75c696ae2b32f5faa5f80ec3fca96b8.tar.xz
options: add "choice" option type, use for -pts-association-mode
Add a "choice" option type. Options of this type take a string as input and set an int option variable to the value corresponding to the string. The string->int mapping is option-specific and is given in the option definition. Strings not found in the mapping are rejected as invalid option values. Change the option -pts-association-mode to use this new option type and accept values "auto, decoder, sort" instead of "0, 1, 2". The change in accepted values shouldn't cause problems as this option is not appropriate to use in normal user config files.
Diffstat (limited to 'cfg-mplayer.h')
-rw-r--r--cfg-mplayer.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/cfg-mplayer.h b/cfg-mplayer.h
index be52df881a..3545b77716 100644
--- a/cfg-mplayer.h
+++ b/cfg-mplayer.h
@@ -309,7 +309,8 @@ const m_option_t mplayer_opts[]={
// a-v sync stuff:
OPT_MAKE_FLAGS("correct-pts", user_correct_pts, 0),
- OPT_INTRANGE("pts-association-mode", user_pts_assoc_mode, 0, 0, 2),
+ OPT_CHOICE("pts-association-mode", user_pts_assoc_mode, 0,
+ ({"auto", 0}, {"decoder", 1}, {"sort", 2})),
OPT_MAKE_FLAGS("initial-audio-sync", initial_audio_sync, 0),
OPT_FLAG_CONSTANTS("noautosync", autosync, 0, 0, -1),
OPT_INTRANGE("autosync", autosync, 0, 0, 10000),