diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-01-03 01:25:57 +0100 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-01-03 01:25:57 +0100 |
commit | 760c9b664fb211d720111b2e462092180acae44c (patch) | |
tree | c7d9243d5f57b9d182629886889f0f6adbe40438 /src/xine-engine | |
parent | 299a77d45f12f0e9103925a86b985f307e8eee6d (diff) | |
download | xine-lib-760c9b664fb211d720111b2e462092180acae44c.tar.gz xine-lib-760c9b664fb211d720111b2e462092180acae44c.tar.bz2 |
Replace _x_vo_scale_aspect_ratio_name() function with a string table, all the uses already check for the index not to go over ther expected one.
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/vo_scale.c | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/src/xine-engine/vo_scale.c b/src/xine-engine/vo_scale.c index bae84ea96..567b3984a 100644 --- a/src/xine-engine/vo_scale.c +++ b/src/xine-engine/vo_scale.c @@ -311,29 +311,21 @@ void _x_vo_scale_translate_gui2video(vo_scale_t *this, *vid_y = y; } -/* - * Returns description of a given ratio code +/*/ + * @brief Table for description of a given ratio code. + * + * @note changing the size of the elements of the array will break + * ABI, so please don't do that unless you absolutely can't continue + * with the current size. */ - -const char *_x_vo_scale_aspect_ratio_name(int a) { - /* TODO replace this with a string table */ - - switch (a) { - case XINE_VO_ASPECT_AUTO: - return "auto"; - case XINE_VO_ASPECT_SQUARE: - return "square"; - case XINE_VO_ASPECT_4_3: - return "4:3"; - case XINE_VO_ASPECT_ANAMORPHIC: - return "16:9"; - case XINE_VO_ASPECT_DVB: - return "2:1"; - default: - return "unknown"; - } -} - +const char _x_vo_scale_aspect_ratio_name_table[][8] = { + "auto", /* XINE_VO_ASPECT_AUTO */ + "square", /* XINE_VO_ASPECT_SQUARE */ + "4:3", /* XINE_VO_ASPECT_4_3 */ + "16:9", /* XINE_VO_ASPECT_ANAMORPHIC */ + "2:1", /* XINE_VO_ASPECT_DVB */ + "unknown" /* All the rest */ +}; /* * config callbacks |