+static int vlc_osd_position_from_string( const char *psz_name )
+{
+ static const struct
+ {
+ int i_position;
+ const char *psz_name;
+ } pp_icons[] =
+ { { SUBPICTURE_ALIGN_MASK, "center" },
+ { SUBPICTURE_ALIGN_LEFT, "left" },
+ { SUBPICTURE_ALIGN_RIGHT, "rigth" },
+ { SUBPICTURE_ALIGN_TOP, "top" },
+ { SUBPICTURE_ALIGN_BOTTOM, "bottom" },
+ { SUBPICTURE_ALIGN_TOP |SUBPICTURE_ALIGN_LEFT, "top-left" },
+ { SUBPICTURE_ALIGN_TOP |SUBPICTURE_ALIGN_RIGHT, "top-right" },
+ { SUBPICTURE_ALIGN_BOTTOM|SUBPICTURE_ALIGN_LEFT, "bottom-left" },
+ { SUBPICTURE_ALIGN_BOTTOM|SUBPICTURE_ALIGN_RIGHT, "bottom-right" },
+ { 0, NULL } };
+ int i;
+ for( i = 0; pp_icons[i].psz_name; i++ )
+ {
+ if( !strcmp( psz_name, pp_icons[i].psz_name ) )
+ return pp_icons[i].i_position;
+ }
+ return 0;
+}
+