From 7e366113f75c696ae2b32f5faa5f80ec3fca96b8 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Sat, 18 Dec 2010 01:00:28 +0200 Subject: 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. --- cfg-mplayer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cfg-mplayer.h') 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), -- cgit v1.2.3