diff options
-rw-r--r-- | include/xine/vo_scale.h | 2 | ||||
-rw-r--r-- | src/video_out/video_out_directfb.c | 2 | ||||
-rw-r--r-- | src/video_out/video_out_fb.c | 2 | ||||
-rw-r--r-- | src/video_out/video_out_opengl.c | 2 | ||||
-rw-r--r-- | src/video_out/video_out_sdl.c | 2 | ||||
-rw-r--r-- | src/video_out/video_out_stk.c | 2 | ||||
-rw-r--r-- | src/video_out/video_out_vidix.c | 8 | ||||
-rw-r--r-- | src/video_out/video_out_xcbshm.c | 2 | ||||
-rw-r--r-- | src/video_out/video_out_xshm.c | 2 | ||||
-rw-r--r-- | src/xine-engine/vo_scale.c | 36 |
10 files changed, 26 insertions, 34 deletions
diff --git a/include/xine/vo_scale.h b/include/xine/vo_scale.h index 9c7f8f4f3..686d53c22 100644 --- a/include/xine/vo_scale.h +++ b/include/xine/vo_scale.h @@ -183,7 +183,7 @@ void _x_vo_scale_translate_gui2video(vo_scale_t *self, * Returns description of a given ratio code */ -const char *_x_vo_scale_aspect_ratio_name(int a) XINE_PROTECTED; +extern const char _x_vo_scale_aspect_ratio_name_table[][8] XINE_PROTECTED; /* * initialize rescaling struct diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c index 364c0ab30..d85df411a 100644 --- a/src/video_out/video_out_directfb.c +++ b/src/video_out/video_out_directfb.c @@ -949,7 +949,7 @@ static int directfb_set_property (vo_driver_t *this_gen, value = XINE_VO_ASPECT_NUM_RATIOS-1; xprintf (this->xine, XINE_VERBOSITY_DEBUG, "video_out_directfb: aspect ratio changed to %s.\n", - _x_vo_scale_aspect_ratio_name (value)); + _x_vo_scale_aspect_ratio_name_table[value]); this->sc.user_ratio = value; _x_vo_scale_compute_ideal_size (&this->sc); this->sc.force_redraw = 1; diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c index 5c7ec15aa..17224ecad 100644 --- a/src/video_out/video_out_fb.c +++ b/src/video_out/video_out_fb.c @@ -632,7 +632,7 @@ static int fb_set_property(vo_driver_t *this_gen, int property, int value) value = XINE_VO_ASPECT_AUTO; this->sc.user_ratio = value; xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_fb: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value)); + "video_out_fb: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]); break; case VO_PROP_BRIGHTNESS: diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c index 466aeda27..21383453e 100644 --- a/src/video_out/video_out_opengl.c +++ b/src/video_out/video_out_opengl.c @@ -1613,7 +1613,7 @@ static int opengl_set_property (vo_driver_t *this_gen, this->sc.force_redraw = 1; /* trigger re-calc of output size */ xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_opengl: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value)); + "video_out_opengl: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]); break; case VO_PROP_BRIGHTNESS: this->yuv2rgb_brightness = value; diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c index de9736845..13a84475d 100644 --- a/src/video_out/video_out_sdl.c +++ b/src/video_out/video_out_sdl.c @@ -384,7 +384,7 @@ static int sdl_set_property (vo_driver_t *this_gen, value = XINE_VO_ASPECT_AUTO; this->sc.user_ratio = value; xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_sdl: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value)); + "video_out_sdl: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]); sdl_compute_ideal_size (this); this->sc.force_redraw = 1; diff --git a/src/video_out/video_out_stk.c b/src/video_out/video_out_stk.c index ba4687b08..e68efb30b 100644 --- a/src/video_out/video_out_stk.c +++ b/src/video_out/video_out_stk.c @@ -327,7 +327,7 @@ static int stk_set_property (vo_driver_t* this_gen, int property, int value) { value = XINE_VO_ASPECT_AUTO; this->sc.user_ratio = value; xprintf(this->xine, XINE_VERBOSITY_DEBUG, - "video_out_stk: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value)); + "video_out_stk: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]); stk_compute_ideal_size (this); this->sc.force_redraw = 1; diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c index d0a45a58c..f4b74ad2a 100644 --- a/src/video_out/video_out_vidix.c +++ b/src/video_out/video_out_vidix.c @@ -733,12 +733,12 @@ static int vidix_set_property (vo_driver_t *this_gen, this->props[property].value = value; if ( property == VO_PROP_ASPECT_RATIO) { - lprintf("video_out_vidix: aspect ratio changed to %s\n", - _x_vo_scale_aspect_ratio_name(value)); - - if(value == XINE_VO_ASPECT_NUM_RATIOS) + if(value >= XINE_VO_ASPECT_NUM_RATIOS) value = this->props[property].value = XINE_VO_ASPECT_AUTO; + lprintf("video_out_vidix: aspect ratio changed to %s\n", + _x_vo_scale_aspect_ratio_name_table[value]); + this->sc.user_ratio = value; vidix_compute_ideal_size (this); this->sc.force_redraw = 1; diff --git a/src/video_out/video_out_xcbshm.c b/src/video_out/video_out_xcbshm.c index 1f649dfd4..bb19058f5 100644 --- a/src/video_out/video_out_xcbshm.c +++ b/src/video_out/video_out_xcbshm.c @@ -756,7 +756,7 @@ static int xshm_set_property (vo_driver_t *this_gen, value = XINE_VO_ASPECT_AUTO; this->sc.user_ratio = value; xprintf(this->xine, XINE_VERBOSITY_DEBUG, - LOG_MODULE ": aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value)); + LOG_MODULE ": aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]); } else if (property == VO_PROP_BRIGHTNESS) { diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index f6f6bafbe..ecaf61f06 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.c @@ -845,7 +845,7 @@ static int xshm_set_property (vo_driver_t *this_gen, value = XINE_VO_ASPECT_AUTO; this->sc.user_ratio = value; xprintf(this->xine, XINE_VERBOSITY_DEBUG, - LOG_MODULE ": aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value)); + LOG_MODULE ": aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]); } else if (property == VO_PROP_BRIGHTNESS) { 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 |