[vlc-devel] [PATCH] lib: use explicit array initialisation syntax for position table
Mark Lee
mark.lee at capricasoftware.co.uk
Sat May 24 14:00:24 CEST 2014
Also use unsigned char rather than int as the type
---
lib/media_player.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lib/media_player.c b/lib/media_player.c
index e244bc0..4477a6a 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -1450,16 +1450,16 @@ void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi )
* Private lookup table to get subpicture alignment flag values corresponding
* to a libvlc_position_t enumerated value.
*/
-static const int position_subpicture_alignment[] = {
- 0,
- SUBPICTURE_ALIGN_LEFT,
- SUBPICTURE_ALIGN_RIGHT,
- SUBPICTURE_ALIGN_TOP,
- SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_LEFT,
- SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_RIGHT,
- SUBPICTURE_ALIGN_BOTTOM,
- SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_LEFT,
- SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_RIGHT
+static const unsigned char position_subpicture_alignment[] = {
+ [libvlc_position_center] = 0,
+ [libvlc_position_left] = SUBPICTURE_ALIGN_LEFT,
+ [libvlc_position_right] = SUBPICTURE_ALIGN_RIGHT,
+ [libvlc_position_top] = SUBPICTURE_ALIGN_TOP,
+ [libvlc_position_top_left] = SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_LEFT,
+ [libvlc_position_top_right] = SUBPICTURE_ALIGN_TOP | SUBPICTURE_ALIGN_RIGHT,
+ [libvlc_position_bottom] = SUBPICTURE_ALIGN_BOTTOM,
+ [libvlc_position_bottom_left] = SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_LEFT,
+ [libvlc_position_bottom_right] = SUBPICTURE_ALIGN_BOTTOM | SUBPICTURE_ALIGN_RIGHT
};
void libvlc_media_player_set_video_title_display( libvlc_media_player_t *p_mi, libvlc_position_t position, unsigned timeout )
--
1.9.1
More information about the vlc-devel
mailing list