From 5a2825ec35446ae2127c0fb204203cd09738c4ed Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 2 Apr 2015 23:54:08 +0200 Subject: 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.) --- video/csputils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'video/csputils.h') diff --git a/video/csputils.h b/video/csputils.h index 14acf03be5..449d883ecb 100644 --- a/video/csputils.h +++ b/video/csputils.h @@ -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)) -- cgit v1.2.3