video: cleanup stereo mode parsing

Use OPT_CHOICE_C() instead of the custom parser. The functionality is
pretty much equivalent.

(On a side note, it seems --video-stereo-mode can't be removed, because
it controls whether to "reduce" stereo video to mono, which is also the
default. In fact I'm not sure how this should be handled at all.)
This commit is contained in:
wm4
2015-04-02 23:54:08 +02:00
parent 19f56e2097
commit 5a2825ec35
7 changed files with 22 additions and 80 deletions

View File

@@ -104,10 +104,10 @@ enum mp_stereo3d_mode {
MP_STEREO3D_COUNT = 13, // 12 is last valid mode
};
extern const char *const mp_stereo3d_names[MP_STEREO3D_COUNT];
extern const struct m_opt_choice_alternatives mp_stereo3d_names[];
#define MP_STEREO3D_NAME(x) m_opt_choice_str(mp_stereo3d_names, x)
#define MP_STEREO3D_NAME(x) \
((x) >= 0 && (x) < MP_STEREO3D_COUNT ? (char *)mp_stereo3d_names[(x)] : NULL)
#define MP_STEREO3D_NAME_DEF(x, def) \
(MP_STEREO3D_NAME(x) ? MP_STEREO3D_NAME(x) : (def))