diff options
author | wm4 <wm4@nowhere> | 2015-08-28 14:35:41 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-08-28 14:51:35 +0200 |
commit | c52af17682c130fa5324f9a4b4c53713c78cedaa (patch) | |
tree | 0ef3757be1e0c2183193c41e6455b41597dd919c /libass | |
parent | b658669c0df5ef3adacd92cc29a9e679bd8bdd2f (diff) | |
download | libass-c52af17682c130fa5324f9a4b4c53713c78cedaa.tar.bz2 libass-c52af17682c130fa5324f9a4b4c53713c78cedaa.tar.xz |
ass: restore ABI compatibility with older versions (more or less)
While enums normally are ints on most systems, it isn't guaranteed. This
might also make C++ code fail to compile, since C++ doesn't allow
implicit conversion of ints to enums.
If the API user ever passed anything other than 0 or 1, compatibility
will still break, but I guess we have to live with this.
Also extend the doxygen.
Diffstat (limited to 'libass')
-rw-r--r-- | libass/ass.h | 9 | ||||
-rw-r--r-- | libass/ass_render_api.c | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libass/ass.h b/libass/ass.h index 576e168..6049257 100644 --- a/libass/ass.h +++ b/libass/ass.h @@ -419,7 +419,12 @@ void ass_get_available_font_providers(ASS_Library *priv, * \param default_font path to default font to use. Must be supplied if * fontconfig is disabled or unavailable. * \param default_family fallback font family for fontconfig, or NULL - * \param fc whether to use fontconfig + * \param dfp which font provider to use (one of ASS_DefaultFontProvider). In + * older libass version, this could be 0 or 1, where 1 enabled fontconfig. + * Newer relases also accept 0 (ASS_FONTPROVIDER_NONE) and 1 + * (ASS_FONTPROVIDER_AUTODETECT), which is almost backward-compatible. + * If the requested fontprovider does not exist or fails to initialize, the + * behavior is the same as when ASS_FONTPROVIDER_NONE was passed. * \param config path to fontconfig configuration file, or NULL. Only relevant * if fontconfig is used. * \param update whether fontconfig cache should be built/updated now. Only @@ -428,7 +433,7 @@ void ass_get_available_font_providers(ASS_Library *priv, * NOTE: font lookup must be configured before an ASS_Renderer can be used. */ void ass_set_fonts(ASS_Renderer *priv, const char *default_font, - const char *default_family, ASS_DefaultFontProvider dfp, + const char *default_family, int dfp, const char *config, int update); /** diff --git a/libass/ass_render_api.c b/libass/ass_render_api.c index efc88f1..a23cd20 100644 --- a/libass/ass_render_api.c +++ b/libass/ass_render_api.c @@ -135,7 +135,7 @@ void ass_set_line_position(ASS_Renderer *priv, double line_position) } void ass_set_fonts(ASS_Renderer *priv, const char *default_font, - const char *default_family, ASS_DefaultFontProvider dfp, + const char *default_family, int dfp, const char *config, int update) { free(priv->settings.default_font); |